ci: update node versions #17
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: CI/CD Pipeline | |
on: | |
push: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: | |
- 14.21.3-buster | |
- 16.20.1-buster | |
- 18.17.0-buster | |
container: | |
image: node:${{ matrix.node-version }} | |
services: | |
postgres: | |
image: postgres:13.2 | |
env: | |
POSTGRES_DB: graphile | |
POSTGRES_PASSWORD: graphile | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
NODE_ENV: test | |
REDIS_URL: redis://redis:6379 | |
TEST_DATABASE_URL: postgres://postgres:graphile@postgres/graphile | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-node:${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node:${{ matrix.node-version }}-yarn- | |
- run: yarn install | |
- name: Lint Apps | |
shell: bash | |
run: yarn lint | |
- name: Migrate worker | |
shell: bash | |
run: yarn graphile-worker -c "$TEST_DATABASE_URL" --schema-only | |
- name: Run Tests | |
shell: bash | |
run: yarn test --detectOpenHandles --forceExit |