-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): replace CircleCI with Github Actions workflow (#187)
- Add a GitHub Actions config for running tests, typechecking and linting - Test against all supported versions of Postgres (11-15) and Node.js (14-18) - Remove the CircleCI config - Format with prettier
- Loading branch information
Showing
7 changed files
with
133 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Node CI | ||
|
||
on: push | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TERM: xterm | ||
FORCE_COLOR: 1 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install | ||
run: yarn --immutable --ignore-engines | ||
|
||
- name: Check Code Format | ||
run: yarn format:check | ||
|
||
- name: Lint Code | ||
run: yarn lint | ||
|
||
- name: Typecheck | ||
run: yarn typecheck | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
CI: true | ||
PGVERSION: ${{ matrix.postgres-version}} | ||
TEST_DATABASE_URL: postgres://postgres:[email protected]:5432/graphile_test_c | ||
TERM: xterm | ||
FORCE_COLOR: 1 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
postgres-version: | ||
- 11 | ||
- 12 | ||
- 13 | ||
- 14 | ||
- 15 | ||
node-version: | ||
- 14.x | ||
- 16.x | ||
- 18.x | ||
|
||
services: | ||
postgres: | ||
image: postgres:${{ matrix.postgres-version }} | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- "0.0.0.0:5432:5432" | ||
# needed because the postgres container does not provide a healthcheck | ||
options: | ||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s | ||
--health-retries 5 --name postgres | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Configure PostgreSQL | ||
run: | | ||
cat .github/workflows/ci/docker-entrypoint-initdb.d/010-setup.sh | docker exec -i postgres bash | ||
- name: Install | ||
run: yarn --immutable --ignore-engines | ||
|
||
- name: Test | ||
run: yarn test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
createdb graphile_test_c -U postgres --template template0 --lc-collate C |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"trailingComma": "es5" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Jest Tests", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeArgs": ["--inspect-brk", "${workspaceRoot}/node_modules/.bin/jest", "--runInBand"], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
} | ||
] | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug Jest Tests", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeArgs": [ | ||
"--inspect-brk", | ||
"${workspaceRoot}/node_modules/.bin/jest", | ||
"--runInBand" | ||
], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
} | ||
] | ||
} |
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
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