From 55cc8637c6d3668f2a9c460b23f4fea295ea0904 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Thu, 28 Aug 2025 16:43:17 -0600 Subject: [PATCH] ci: restrict workflow execution to main branch and add concurrency (#586) * ci: try adding concurrency * ci: restrict push on main branch * ci: fix concurrency key * ci: fix build concurrency * refactor: apply suggestion from @pr-agent-monadical[bot] Co-authored-by: pr-agent-monadical[bot] <198624643+pr-agent-monadical[bot]@users.noreply.github.com> --------- Co-authored-by: pr-agent-monadical[bot] <198624643+pr-agent-monadical[bot]@users.noreply.github.com> --- .github/workflows/db_migrations.yml | 5 +++++ .github/workflows/test_server.yml | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/db_migrations.yml b/.github/workflows/db_migrations.yml index ff8ad59a..2b80c3a1 100644 --- a/.github/workflows/db_migrations.yml +++ b/.github/workflows/db_migrations.yml @@ -2,6 +2,8 @@ name: Test Database Migrations on: push: + branches: + - main paths: - "server/migrations/**" - "server/reflector/db/**" @@ -17,6 +19,9 @@ on: jobs: test-migrations: runs-on: ubuntu-latest + concurrency: + group: db-ubuntu-latest-${{ github.ref }} + cancel-in-progress: true services: postgres: image: postgres:17 diff --git a/.github/workflows/test_server.yml b/.github/workflows/test_server.yml index 262e0e05..f03d020e 100644 --- a/.github/workflows/test_server.yml +++ b/.github/workflows/test_server.yml @@ -5,12 +5,17 @@ on: paths: - "server/**" push: + branches: + - main paths: - "server/**" jobs: pytest: runs-on: ubuntu-latest + concurrency: + group: pytest-${{ github.ref }} + cancel-in-progress: true services: redis: image: redis:6 @@ -30,6 +35,9 @@ jobs: docker-amd64: runs-on: linux-amd64 + concurrency: + group: docker-amd64-${{ github.ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx @@ -45,6 +53,9 @@ jobs: docker-arm64: runs-on: linux-arm64 + concurrency: + group: docker-arm64-${{ github.ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v4 - name: Set up Docker Buildx