Skip to content

Bump rails to 7.2.2.2 (#83) #175

Bump rails to 7.2.2.2 (#83)

Bump rails to 7.2.2.2 (#83) #175

Workflow file for this run

name: Test
on: [push]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby-version:
- '3.3'
- '3.4'
name: Ruby ${{ matrix.ruby-version }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: rails
POSTGRES_PASSWORD: rails_password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
DB_HOST: localhost
DB_PORT: 5432
DB_USERNAME: rails
DB_PASSWORD: rails_password
steps:
- uses: actions/checkout@v2
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby-version }}
- name: Inject configuration
run: cp config/database.yml{.ci,}
- name: Prepare the database
run: bin/rails db:setup
- name: Run tests
run: bin/rails test
brakeman:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Run Brakeman analysis
run: bundle exec brakeman
bundle-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby + Bundle
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Audit the bundle
run: bundle exec bundle-audit check --update
# A utility job upon which Branch Protection can depend,
# thus remaining agnostic of the matrix.
test_matrix:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Matrix
needs: test
steps:
- name: Check build matrix status
if: ${{ needs.test.result != 'success' }}
run: exit 1
notify:
# Run only on master, but regardless of whether tests past:
if: ${{ always() && github.ref == 'refs/heads/master' }}
needs:
- test_matrix
- brakeman
- bundle-audit
runs-on: ubuntu-latest
steps:
- uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,commit,author
custom_payload: |
{
channel: 'CSCHWSP53',
username: 'CI',
icon_emoji: ':hammer_and_wrench:',
attachments: [{
color: '${{ needs.test.result }}' === 'success' ? 'good' : '${{ needs.test.result }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW} against \`${{ github.ref }}\` (${process.env.AS_COMMIT}) for ${{ github.actor }} resulted in *${{ needs.test.result }}*.`
},{
color: '${{ needs.brakeman.result }}' === 'success' ? 'good' : '${{ needs.brakeman.result }}' === 'failure' ? 'danger' : 'warning',
text: `Brakeman checks returned *${{ needs.brakeman.result }}*.`
},{
color: '${{ needs.bundle-audit.result }}' === 'success' ? 'good' : '${{ needs.bundle-audit.result }}' === 'failure' ? 'danger' : 'warning',
text: `Bundle Audit checks returned *${{ needs.bundle-audit.result }}*.`
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}