Try reloading database config #437
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
--- | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: pages_test | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
jobs: | |
rubocop-test: | |
name: Rubocop | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.3 | |
- name: Check code | |
run: bundle exec rubocop | |
eslint-test: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: true | |
- name: Check code | |
run: pnpm lint | |
typescript-test: | |
name: Typescript | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: true | |
- name: Check code | |
run: pnpm tsc --noEmit | |
rspec-test: | |
name: RSpec | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
strategy: | |
matrix: | |
ruby: ["3.2", "3.3"] | |
services: | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: ${{ env.POSTGRES_USER }} | |
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | |
POSTGRES_DB: ${{ env.POSTGRES_DB }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install system dependencies | |
run: sudo apt-get install -y libpq-dev libvips42 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9 | |
run_install: true | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Create database | |
env: | |
RAILS_ENV: test | |
run: | | |
bundle exec rake db:migrate | |
- name: Reload database config | |
run: psql -c "SELECT pg_reload_conf()" | |
- name: Run tests | |
run: bundle exec rspec | |
- name: Send results to Code Climate | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: ls | |
notify-slack: | |
name: Slack notification | |
if: "always() && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[ci skip]')" | |
needs: | |
- rubocop-test | |
- eslint-test | |
- typescript-test | |
- rspec-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prepare message | |
id: message | |
uses: anyone-oslo/github-action-notify-slack@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.run_id }} | |
run-number: ${{ github.run_number }} | |
- name: Send to Slack | |
if: success() | |
run: | | |
curl -X POST ${{ secrets.SLACK_WEBHOOK_URL}} -H "Content-type: application/json" --data '${{ steps.message.outputs.message }}' |