Merge pull request #46 from TrailBuddies/snyk-fix-d0d8f0a1a272d7ab75c… #187
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: CI | |
env: | |
# Required app environment variables | |
# https://github.com/TrailBuddies/api#environment-variables | |
DEV_API_DB_USER: test | |
DEV_API_DB_PASSWORD: test | |
EMAIL: [email protected] | |
PASSWORD: test1234 | |
# CLOUDINARY_SECRET: ${{ secrets.CLOUDINARY_SECRET }} | |
# TOMTOM_API_KEY: ${{ secrets.TOMTOM_API_KEY }} | |
PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:14 | |
env: | |
POSTGRES_USER: ${{ env.DEV_API_DB_USER }} | |
POSTGRES_DB: ${{ env.DEV_API_DB_USER }} | |
POSTGRES_PASSWORD: ${{ env.DEV_API_DB_PASSWORD }} | |
ports: ['5432:5432'] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
PASSPHRASE: test-${{ matrix.os }}-${{ github.run_id }} | |
steps: | |
- uses: actions/checkout@master | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
ruby-version: 3.1.2 | |
env: | |
BUNDLE_DEPLOYMENT: "false" | |
- name: Setup Rails Database | |
run: RAILS_ENV='test' bin/keygen && bin/rails db:setup | |
- name: Test & publish code coverage | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageCommand: bin/rails test | |
coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov | |
debug: true |