# tag version v2.3.2 #35
Workflow file for this run
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: Test | |
on: [push] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
ruby-version: | |
- '3.0' | |
- '3.1' | |
- '3.2' | |
- '3.3' | |
gemfile: | |
- gemfiles/Gemfile.rails61 | |
- gemfiles/Gemfile.rails70 | |
- gemfiles/Gemfile.rails71 | |
- gemfiles/Gemfile.rails72 | |
exclude: | |
# rails 7.2 requires ruby >= 3.1 | |
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html | |
- ruby-version: '3.0' | |
gemfile: 'gemfiles/Gemfile.rails72' | |
# rails 8.0 requires ruby >= 3.2 | |
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html | |
- ruby-version: '3.0' | |
gemfile: 'gemfiles/Gemfile.rails80' | |
- ruby-version: '3.1' | |
gemfile: 'gemfiles/Gemfile.rails80' | |
name: Ruby ${{ matrix.ruby-version }} / Bundle ${{ matrix.gemfile }} | |
runs-on: ubuntu-latest | |
env: | |
BUNDLE_GEMFILE: ${{ matrix.gemfile }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
- name: Install dependencies | |
run: bundle install | |
- name: Prepare SQLite | |
run: RAILS_ENV=test bundle exec rake db:migrate --trace | |
- name: Run tests | |
run: bundle exec rails test | |
# 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 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: 8398a7/action-slack@v3 | |
with: | |
status: custom | |
fields: workflow,commit,author | |
custom_payload: | | |
{ | |
channel: 'C7FQWGDHP', | |
username: 'CI – ' + '${{ github.repository }}'.split('/')[1], | |
icon_emoji: ':hammer_and_wrench:', | |
attachments: [{ | |
color: '${{ needs.test_matrix.result }}' === 'success' ? 'good' : '${{ needs.test_matrix.result }}' === 'failure' ? 'danger' : 'warning', | |
text: `${process.env.AS_WORKFLOW} against \`${{ github.ref }}\` (${process.env.AS_COMMIT}) for ${{ github.actor }} resulted in *${{ needs.test_matrix.result }}*.` | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |