Bump ruff from 0.13.3 to 0.14.0 #182
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PR | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.user.login != 'dependabot[bot]' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 100 | |
- name: Print build name | |
run: echo "$GITHUB_ACTOR is building PR#$PR_NUMBER in '$GITHUB_REPOSITORY' (commit $GITHUB_SHA)" | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.local/share/virtualenvs | |
key: ${{ runner.os }}-dependency-cache | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12.6" | |
- name: Install pipenv | |
run: pip install --no-cache-dir pipenv | |
- name: Lint checks | |
run: ./tools/run_lint.sh | |
- name: Test the service | |
env: | |
BUILD_QUALITY: "PR" | |
run: ./tools/run_tests.sh | |
- name: Build Docker image | |
run: docker build . --file Dockerfile --tag the-agent | |
- name: Auth for GitHub's Docker repository | |
env: | |
USER: ${{ secrets.PACKAGES_USER }} | |
TOKEN: ${{ secrets.PACKAGES_TOKEN }} | |
run: echo $TOKEN | docker login docker.pkg.github.com --username $USER --password-stdin | |
- name: Tag Docker image | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
VERSION=$(cat .version | tr -d '[:space:]') | |
echo "Tagging images with version '$VERSION'..." | |
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".pr_$PR_NUMBER | |
docker tag the-agent docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_pr | |
docker tag the-agent appifyhub/the-agent:"$VERSION".pr_$PR_NUMBER | |
docker tag the-agent appifyhub/the-agent:latest_pr | |
- name: Publish Docker images to GitHub | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
VERSION=$(cat .version | tr -d '[:space:]') | |
echo "Publishing images with version '$VERSION'..." | |
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:"$VERSION".pr_$PR_NUMBER | |
docker push docker.pkg.github.com/$GITHUB_REPOSITORY/the-agent:latest_pr | |
- name: Publish Docker images to DockerHub | |
id: docker_publish | |
env: | |
USER: ${{ secrets.DOCKER_HUB_USER }} | |
TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
run: | | |
VERSION=$(cat .version | tr -d '[:space:]') | |
docker login docker.io -u $USER -p $TOKEN | |
echo "Publishing images with version '$VERSION'..." | |
docker push appifyhub/the-agent:"$VERSION".pr_$PR_NUMBER | |
docker push appifyhub/the-agent:latest_pr | |
echo ::set-output name=the_agent_version::"$VERSION" | |
- name: Comment build information | |
env: | |
GITHUB_SHA: ${{ env.GITHUB_SHA }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_RUN_ID: ${{ env.GITHUB_RUN_ID }} | |
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }} | |
GITHUB_SERVER_URL: ${{ env.GITHUB_SERVER_URL }} | |
PR_NUMBER: ${{ github.event.number }} | |
VERSION: ${{ steps.docker_publish.outputs.the_agent_version }} | |
DOCKER_IMG: "docker pull appifyhub/the-agent" | |
run: | | |
NL=$'\n' | |
CODE='```' | |
DOCKER_VERSIONED="$DOCKER_IMG:$VERSION.pr_$PR_NUMBER" | |
DOCKER_LATEST="# Valid until a new build${NL}${DOCKER_IMG}:latest_pr" | |
CODE_BLOCK="${CODE}shell${NL}${DOCKER_LATEST}${NL}${DOCKER_VERSIONED}${NL}${CODE}" | |
JOB="[${GITHUB_RUN_ID}](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})" | |
NOTIFICATION="Build ${JOB} complete for ${GITHUB_SHA}.${NL}${NL}${CODE_BLOCK}${NL}" | |
gh pr comment "$PR_NUMBER" -b "$NOTIFICATION" | |
- name: Publish to GitHub Releases | |
id: publish_github_release | |
env: | |
ARTIFACT: "the-agent" | |
BUILD_QUALITY: "PR" | |
VERSION: ${{ steps.docker_publish.outputs.the_agent_version }} | |
GITHUB_SHA: ${{ env.GITHUB_SHA }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }} | |
run: pipenv run python tools/publish_github_release.py |