From f174058f43e70a047b91af91bef40ab0fb048323 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 27 Nov 2025 07:57:08 +0100 Subject: [PATCH] Extract common checks to its own workflow to only run once --- .github/workflows/ci-checks.yml | 41 ++++++++++++++++++++++++++ .github/workflows/ci-oss.yml | 4 +-- .github/workflows/ci-saas.yml | 4 +-- .github/workflows/{ci.yml => test.yml} | 38 +----------------------- 4 files changed, 46 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/ci-checks.yml rename .github/workflows/{ci.yml => test.yml} (69%) diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml new file mode 100644 index 000000000..b795667cf --- /dev/null +++ b/.github/workflows/ci-checks.yml @@ -0,0 +1,41 @@ +name: Checks + +on: + push: + pull_request: + +jobs: + security: + name: Security + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Gem audit + run: bin/bundler-audit check --update + + - name: Importmap audit + run: bin/importmap audit + + - name: Brakeman audit + run: bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error + + + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: .ruby-version + bundler-cache: true + + - name: Lint code for consistent style + run: bin/rubocop diff --git a/.github/workflows/ci-oss.yml b/.github/workflows/ci-oss.yml index 1aedd63b5..724cc3ec6 100644 --- a/.github/workflows/ci-oss.yml +++ b/.github/workflows/ci-oss.yml @@ -4,7 +4,7 @@ on: pull_request: jobs: - call-ci: - uses: ./.github/workflows/ci.yml + test: + uses: ./.github/workflows/test.yml with: saas: false diff --git a/.github/workflows/ci-saas.yml b/.github/workflows/ci-saas.yml index 69196d1a4..27c33e7cd 100644 --- a/.github/workflows/ci-saas.yml +++ b/.github/workflows/ci-saas.yml @@ -4,8 +4,8 @@ on: push: jobs: - call-ci: - uses: ./.github/workflows/ci.yml + test: + uses: ./.github/workflows/test.yml with: saas: true secrets: diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 69% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 7984fca66..da6dc4a61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Common CI +name: Test on: workflow_call: @@ -11,42 +11,6 @@ on: required: false jobs: - security: - name: Security - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Gem audit - run: bin/bundler-audit check --update - - - name: Importmap audit - run: bin/importmap audit - - - name: Brakeman audit - run: bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error - - - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: .ruby-version - bundler-cache: true - - - name: Lint code for consistent style - run: bin/rubocop - - test: name: Tests (${{ matrix.mode }}) runs-on: ubuntu-latest