chore(deps): update all actions #2842
This file contains 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: Continuous Integration | |
on: | |
push: | |
branches: [staging, master] | |
pull_request: | |
merge_group: | |
workflow_call: | |
inputs: | |
sha: | |
description: The commit SHA to run the workflow on | |
required: false | |
type: string | |
secrets: | |
codecov_token: | |
description: Codecov token | |
required: true | |
rails_master_key: | |
description: The Rails master key | |
required: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ inputs.sha }} | |
- name: Build test image | |
uses: guidojw/actions/build-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7 | |
with: | |
file: Dockerfile | |
build-args: | | |
RAILS_ENV=test | |
name: app | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
needs: build | |
services: | |
db: | |
image: postgres:14.7 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ inputs.sha }} | |
- name: Add problem matchers | |
run: | | |
echo '::add-matcher::.github/problem-matchers/actionlint.json' | |
echo '::add-matcher::.github/problem-matchers/eslint-stylish.json' | |
echo '::add-matcher::.github/problem-matchers/rubocop.json' | |
- name: Download actionlint | |
run: | | |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.6.26 | |
- name: Load test image | |
uses: guidojw/actions/load-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7 | |
with: | |
name: app | |
- name: Lint | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
run: | | |
EXIT_STATUS=0 | |
./actionlint -ignore 'property "gh_app_private_key" is not defined' -ignore 'SC2153:' \ | |
-ignore 'property "sha" is not defined in object type {}' || EXIT_STATUS=$? | |
docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ | |
RAILS_MASTER_KEY --network=host app bin/ci.sh lint || EXIT_STATUS=$? | |
exit $EXIT_STATUS | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: build | |
services: | |
db: | |
image: postgres:14.7 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ inputs.sha }} | |
- name: Add problem matchers | |
run: | | |
echo '::add-matcher::.github/problem-matchers/rspec.json' | |
- name: Load test image | |
uses: guidojw/actions/load-docker-image@3ad963828827110a6b716a011f242bf01fdf1db4 # v1.4.7 | |
with: | |
name: app | |
- name: Test | |
env: | |
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
run: | | |
mkdir coverage | |
docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_HOST=localhost -e \ | |
RAILS_MASTER_KEY --network=host -v "$(pwd)"'/coverage:/app/coverage' app bin/ci.sh spec | |
- name: Upload coverage report to Codecov | |
if: ${{ !cancelled() }} | |
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload coverage report artifact | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
with: | |
name: coverage | |
path: coverage/ | |
if-no-files-found: error |