chore(deps): update postgres docker tag to v17 #2491
This file contains hidden or 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: Lint & test | |
on: | |
push: | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
id-token: write # to get access to GitHub autogenerated OIDC token, used by codecov/codecov-action | |
steps: | |
- uses: actions/[email protected] | |
- name: Setup Ruby | |
# Install the version defined in .ruby-version | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
rubygems: latest | |
env: | |
BUNDLE_FROZEN: "true" | |
- name: Start RuboCop server | |
# Running RuboCop automatically starts the server if it isn't already running, | |
# but the "RuboCop server starting on 127.0.0.1:41619" message confuses OverCommit | |
# when it tries to parse the result. | |
# Starting it manually before will prevent that. | |
run: bundle exec rubocop --start-server | |
- name: Run git hooks | |
run: | | |
# Sign Overcommit configuration | |
bundle exec overcommit --sign | |
# Sign our custom hooks | |
bundle exec overcommit --sign pre-commit | |
bundle exec overcommit --run | |
env: | |
OVERCOMMIT_COLOR: "1" | |
- name: Run RuboCop | |
run: bin/rubocop --parallel --format github | |
- name: Configure PostgreSQL authentication | |
run: | | |
# Add our authentication line before everything else | |
# https://unix.stackexchange.com/a/99351 | |
sudo sed --in-place '1 i\local all lea5 scram-sha-256' /etc/postgresql/*/main/pg_hba.conf | |
sudo systemctl restart postgresql.service | |
- name: Create PostgreSQL user and database | |
run: cp ./.github/workflows/init_db.sql /tmp/ && sudo --user postgres psql --file /tmp/init_db.sql | |
- name: Migrate database | |
env: | |
RAILS_ENV: test | |
run: bin/rails db:test:prepare | |
- name: Run all tests, including system (end-to-end) tests | |
id: tests | |
env: | |
RAILS_ENV: test | |
run: bin/rails test:all | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
use_oidc: true | |
- name: Keep screenshots from failed system tests | |
uses: actions/[email protected] | |
if: failure() && steps.tests.conclusion == 'failure' | |
with: | |
name: screenshots | |
path: ${{ github.workspace }}/tmp/screenshots | |
if-no-files-found: ignore | |
- name: Upload test results to Codecov | |
uses: codecov/[email protected] | |
if: ${{ !cancelled() }} | |
with: | |
use_oidc: true | |
disable_search: true | |
files: ./test/reports/TEST-*.xml |