From e7b1041f9e7639c06874bbefd7df75c12600e357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Mon, 10 Feb 2025 04:50:59 +0100 Subject: [PATCH] Update GitHub Actions workflow to enhance testing and building process --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b105ee0..7f0ea6d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,15 @@ --- -name: Test code +name: Test and build Docker image on: - schedule: - - cron: "27 6 * * *" push: pull_request: workflow_dispatch: + schedule: + - cron: "0 6 * * *" + env: TEST_WEBHOOK_URL: ${{ secrets.TEST_WEBHOOK_URL }} + jobs: test: runs-on: ubuntu-latest @@ -16,9 +18,20 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.12 - - run: pipx install poetry - - run: poetry install - - run: poetry run pytest + - uses: astral-sh/setup-uv@v5 + with: + version: "latest" + - run: uv sync --all-extras --all-groups + - run: uv run pytest + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/ruff-action@v3 + with: + version: "latest" + - run: ruff check --exit-non-zero-on-fix --verbose + - run: ruff format --check --verbose build: runs-on: ubuntu-latest @@ -29,9 +42,12 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true - needs: test + needs: [test, ruff] steps: - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + with: + platforms: all - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: @@ -41,6 +57,7 @@ jobs: - uses: docker/build-push-action@v6 with: context: . + platforms: linux/amd64, linux/arm64 push: ${{ github.event_name != 'pull_request' }} tags: | ghcr.io/thelovinator1/discord-rss-bot:latest