Skip to content

Add local login strategy to develop without Keycloak #1621

Add local login strategy to develop without Keycloak

Add local login strategy to develop without Keycloak #1621

Workflow file for this run

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/checkout@v4
- name: Setup Ruby
# Install the version defined in .ruby-version
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
env:
BUNDLE_FROZEN: "true"
- name: Run git hooks
run: |
bundle exec overcommit --sign
bundle exec overcommit --run
env:
OVERCOMMIT_COLOR: "1"
- name: Run RuboCop
run: bundle exec 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
run: bundle exec rails db:migrate RAILS_ENV=test
- name: Run tests
run: bundle exec rails test:all
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
use_oidc: true