-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roland Peelen
committed
Jan 19, 2024
1 parent
dd21527
commit d0fc995
Showing
4 changed files
with
37 additions
and
124 deletions.
There are no files selected for viewing
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,18 +1,22 @@ | ||
name: graphql-ppx-pipeline | ||
|
||
on: [pull_request, push] | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
test_and_build_linux: | ||
test_and_build: | ||
name: ${{ matrix.os }}/node-${{ matrix.node-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
node-version: | ||
- 18.x | ||
ocaml-compiler: | ||
- 5.1.0 | ||
os: [ubuntu-latest] | ||
|
||
container: | ||
image: alexfedoseev/alpine-node-yarn-esy:0.0.4 | ||
image: ocaml/opam:alpine_ocaml-5.15.0 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
@@ -21,117 +25,44 @@ jobs: | |
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Add tar | ||
run: apk add --no-cache tar | ||
- name: Install | ||
run: esy install | ||
|
||
- name: Print esy cache | ||
id: print_esy_cache | ||
run: node .github/workflows/print_esy_cache.js | ||
|
||
- name: Try to restore dependencies cache | ||
uses: actions/cache@v2 | ||
id: deps-cache | ||
with: | ||
path: ${{ steps.print_esy_cache.outputs.esy_cache }} | ||
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }} | ||
restore-keys: | | ||
${{ matrix.os }}- | ||
- name: build | ||
run: esy b | ||
|
||
- name: native tests | ||
run: | | ||
esy b dune runtest -f | ||
env: | ||
CI: true | ||
|
||
- name: snapshot tests | ||
env: | ||
GRAPHQL_CI: true | ||
- name: Install Deps | ||
run: | | ||
make install | ||
npm ci --no-optional --ignore-scripts | ||
esy test | ||
esy release-static | ||
- name: (only on release) Upload artifacts ${{ matrix.os }} | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: ${{ matrix.os }} | ||
path: _build/default/src/bin/bin.exe | ||
- name: Build | ||
run: make build | ||
|
||
test_and_build: | ||
name: ${{ matrix.os }}/node-${{ matrix.node-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
os: [windows-latest, macOS-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install esy | ||
run: | | ||
npm install -g [email protected] | ||
- name: Install | ||
run: esy install | ||
|
||
- name: Print esy cache | ||
id: print_esy_cache | ||
run: node .github/workflows/print_esy_cache.js | ||
|
||
- name: Try to restore dependencies cache | ||
id: deps-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.print_esy_cache.outputs.esy_cache }} | ||
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }} | ||
|
||
- name: build | ||
run: esy b | ||
- name: Native Tests | ||
run: make native-tests | ||
env: | ||
CI: true | ||
|
||
- name: test-native | ||
run: | | ||
esy b dune runtest -f | ||
- name: Snapshot Tests | ||
run: make snapshot-tests | ||
env: | ||
CI: true | ||
|
||
- name: npm ci | ||
if: runner.os != 'Windows' | ||
run: | | ||
npm ci --no-optional | ||
- name: Release Static | ||
env: | ||
GRAPHQL_CI: true | ||
run: make release-static | ||
|
||
- name: snaphot tests | ||
if: runner.os != 'Windows' | ||
run: | | ||
esy test | ||
- name: (only on release) Upload artifacts ${{ matrix.os }} | ||
- name: Upload artifacts ${{ matrix.os }} (Only on release) | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: ${{ matrix.os }} | ||
path: _build/default/src/bin/bin.exe | ||
|
||
publish: | ||
needs: [test_and_build, test_and_build_linux] | ||
needs: [test_and_build] | ||
name: (only on release) Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: "12.x" | ||
node-version: "18.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Download linux artifacts | ||
|
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