Skip to content

Commit

Permalink
Tweak GitHub workflows for docsite additions (#224)
Browse files Browse the repository at this point in the history
- Rename `lint` to `analyze`, merge `audit` step into it
- Ensure all steps use `ubuntu-latest`
- Re-run `analyze` when a PR is reopened
- Upgrade `checkout` and `setup-node` to latest versions, removing
warnings
- Rename `all` to `ready-to-merge`
  • Loading branch information
mcmire committed Feb 18, 2024
1 parent d20ed5d commit 1c86d63
Showing 1 changed file with 23 additions and 51 deletions.
74 changes: 23 additions & 51 deletions .github/workflows/super_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,79 +7,43 @@ on:
pull_request:
types:
- opened
- reopened
- synchronize
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
all:
analyze:
runs-on: ubuntu-latest
needs:
- lint
- audit
- test
outputs:
PASSED: ${{ steps.set-output.outputs.PASSED }}
steps:
- name: Set PASSED output
id: set-output
run: echo "PASSED=true" >> "$GITHUB_OUTPUT"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download actionlint
id: download-actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash) 1.6.23
shell: bash
- name: Check workflow files
run: ${{ steps.download-actionlint.outputs.executable }} -color
shell: bash
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install Yarn dependencies
run: yarn --immutable
- name: Lint
run: yarn lint
audit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "3.0"
- "3.1"
- "3.2"
rails_appraisal:
- rails_6_1
- rails_7_0
- no_rails
rspec_appraisal:
- rspec_lt_3_10
- rspec_gte_3_10
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install Yarn dependencies
run: yarn --immutable
- name: Audit
run: yarn audit

test:
needs:
- lint
- audit
runs-on: ubuntu-20.04
- analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -97,7 +61,7 @@ jobs:
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.rails_appraisal }}_${{ matrix.rspec_appraisal }}.gemfile
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -116,3 +80,11 @@ jobs:
log-output-if: failure
- name: Run tests
run: bundle exec rake --trace

ready-to-merge:
runs-on: ubuntu-latest
needs:
- analyze
- test
steps:
- run: echo "Analysis and tests passed. Ready to merge."

0 comments on commit 1c86d63

Please sign in to comment.