|
1 | 1 | name: graphql-ppx-pipeline |
2 | 2 |
|
3 | | -on: [pull_request, push] |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
4 | 6 |
|
5 | 7 | jobs: |
6 | | - test_and_build_linux: |
| 8 | + test_and_build: |
7 | 9 | name: ${{ matrix.os }}/node-${{ matrix.node-version }} |
8 | 10 | runs-on: ${{ matrix.os }} |
9 | 11 | strategy: |
10 | 12 | matrix: |
11 | | - node-version: [16.x] |
| 13 | + node-version: |
| 14 | + - 18.x |
| 15 | + ocaml-compiler: |
| 16 | + - 5.1.0 |
12 | 17 | os: [ubuntu-latest] |
13 | | - |
14 | 18 | container: |
15 | | - image: alexfedoseev/alpine-node-yarn-esy:0.0.4 |
| 19 | + image: ocaml/opam:alpine-ocaml-5.1-afl |
16 | 20 |
|
17 | 21 | steps: |
18 | 22 | - uses: actions/checkout@v1 |
19 | | - - name: Use Node.js ${{ matrix.node-version }} |
20 | | - uses: actions/setup-node@v1 |
21 | | - with: |
22 | | - node-version: ${{ matrix.node-version }} |
23 | 23 |
|
24 | | - - name: Add tar |
25 | | - run: apk add --no-cache tar |
26 | | - - name: Install |
27 | | - run: esy install |
28 | | - |
29 | | - - name: Print esy cache |
30 | | - id: print_esy_cache |
31 | | - run: node .github/workflows/print_esy_cache.js |
32 | | - |
33 | | - - name: Try to restore dependencies cache |
34 | | - uses: actions/cache@v2 |
35 | | - id: deps-cache |
36 | | - with: |
37 | | - path: ${{ steps.print_esy_cache.outputs.esy_cache }} |
38 | | - key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }} |
39 | | - restore-keys: | |
40 | | - ${{ matrix.os }}- |
41 | | -
|
42 | | - - name: build |
43 | | - run: esy b |
44 | | - |
45 | | - - name: native tests |
46 | | - run: | |
47 | | - esy b dune runtest -f |
48 | | - env: |
49 | | - CI: true |
50 | | - |
51 | | - - name: snapshot tests |
52 | | - env: |
53 | | - GRAPHQL_CI: true |
| 24 | + - name: Install NPM |
| 25 | + run: apk add --update nodejs npm |
| 26 | + |
| 27 | + - name: Install Deps |
54 | 28 | run: | |
| 29 | + make install |
55 | 30 | npm ci --no-optional --ignore-scripts |
56 | | - esy test |
57 | | - esy release-static |
58 | 31 |
|
59 | | - - name: (only on release) Upload artifacts ${{ matrix.os }} |
60 | | - uses: actions/upload-artifact@master |
61 | | - with: |
62 | | - name: ${{ matrix.os }} |
63 | | - path: _build/default/src/bin/bin.exe |
| 32 | + - name: Build |
| 33 | + run: make build |
64 | 34 |
|
65 | | - test_and_build: |
66 | | - name: ${{ matrix.os }}/node-${{ matrix.node-version }} |
67 | | - runs-on: ${{ matrix.os }} |
68 | | - strategy: |
69 | | - matrix: |
70 | | - node-version: [16.x] |
71 | | - os: [windows-latest, macOS-latest] |
72 | | - |
73 | | - steps: |
74 | | - - uses: actions/checkout@v1 |
75 | | - |
76 | | - - name: Use Node.js ${{ matrix.node-version }} |
77 | | - uses: actions/setup-node@v1 |
78 | | - with: |
79 | | - node-version: ${{ matrix.node-version }} |
80 | | - |
81 | | - - name: Install esy |
82 | | - run: | |
83 | | - npm install -g esy@0.6.12 |
84 | | -
|
85 | | - - name: Install |
86 | | - run: esy install |
87 | | - |
88 | | - - name: Print esy cache |
89 | | - id: print_esy_cache |
90 | | - run: node .github/workflows/print_esy_cache.js |
91 | | - |
92 | | - - name: Try to restore dependencies cache |
93 | | - id: deps-cache |
94 | | - uses: actions/cache@v2 |
95 | | - with: |
96 | | - path: ${{ steps.print_esy_cache.outputs.esy_cache }} |
97 | | - key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }} |
98 | | - |
99 | | - - name: build |
100 | | - run: esy b |
| 35 | + - name: Native Tests |
| 36 | + run: make native-tests |
| 37 | + env: |
| 38 | + CI: true |
101 | 39 |
|
102 | | - - name: test-native |
103 | | - run: | |
104 | | - esy b dune runtest -f |
| 40 | + - name: Snapshot Tests |
| 41 | + run: make snapshot-tests |
105 | 42 | env: |
106 | 43 | CI: true |
107 | 44 |
|
108 | | - - name: npm ci |
109 | | - if: runner.os != 'Windows' |
110 | | - run: | |
111 | | - npm ci --no-optional |
| 45 | + - name: Release Static |
112 | 46 | env: |
113 | 47 | GRAPHQL_CI: true |
| 48 | + run: make release-static |
114 | 49 |
|
115 | | - - name: snaphot tests |
116 | | - if: runner.os != 'Windows' |
117 | | - run: | |
118 | | - esy test |
119 | | -
|
120 | | - - name: (only on release) Upload artifacts ${{ matrix.os }} |
| 50 | + - name: Upload artifacts ${{ matrix.os }} (Only on release) |
121 | 51 | uses: actions/upload-artifact@master |
122 | 52 | with: |
123 | 53 | name: ${{ matrix.os }} |
124 | 54 | path: _build/default/src/bin/bin.exe |
125 | 55 |
|
126 | 56 | publish: |
127 | | - needs: [test_and_build, test_and_build_linux] |
| 57 | + needs: [test_and_build] |
128 | 58 | name: (only on release) Publish |
129 | 59 | runs-on: ubuntu-latest |
130 | 60 | steps: |
131 | 61 | - uses: actions/checkout@v1 |
132 | 62 | - uses: actions/setup-node@v1 |
133 | 63 | with: |
134 | | - node-version: "12.x" |
| 64 | + node-version: "18.x" |
135 | 65 | registry-url: "https://registry.npmjs.org" |
136 | 66 |
|
137 | 67 | - name: Download linux artifacts |
|
0 commit comments