-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (67 loc) · 2.06 KB
/
Copy pathtesting.yml
File metadata and controls
72 lines (67 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Test Package
on:
pull_request:
branches:
- '**'
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
test_matrix:
strategy:
fail-fast: true
matrix:
node:
- version: 22
- version: 24
postgres:
- version: 14
- version: 15
- version: 16
- version: 17
- version: 18
graphql:
- version: '16'
spec: '^16.12.0'
- version: '17'
spec: '^17.0.0'
name: test and build package (node ${{ matrix.node.version }}, postgres ${{ matrix.postgres.version }}, graphql ${{ matrix.graphql.version }})
runs-on: ubuntu-latest
container: node:${{ matrix.node.version }}-alpine
services:
postgres: # Label used to access the service container
image: postgres:${{ matrix.postgres.version }}-alpine
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install dependencies
run: npm ci
- name: Install graphql ${{ matrix.graphql.spec }}
# --legacy-peer-deps: @graphql-codegen/* still caps its graphql peer at
# ^16, so installing graphql 17 otherwise trips ERESOLVE (see PR #503).
run: npm install graphql@${{ matrix.graphql.spec }} --legacy-peer-deps
- name: Run tests
run: npm run test
env:
DATABASE_HOST: postgres # Must match the service containers label
test_all:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Test (matrix)
needs: test_matrix
steps:
- name: Check test matrix status
if: ${{ needs.test_matrix.result != 'success' }}
run: exit 1