Skip to content

Commit fab547a

Browse files
author
Roland Peelen
committed
💚 - Fix CI Build.
1 parent dd21527 commit fab547a

4 files changed

Lines changed: 40 additions & 128 deletions

File tree

.github/workflows/pipeline.yml

Lines changed: 27 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,67 @@
11
name: graphql-ppx-pipeline
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
46

57
jobs:
6-
test_and_build_linux:
8+
test_and_build:
79
name: ${{ matrix.os }}/node-${{ matrix.node-version }}
810
runs-on: ${{ matrix.os }}
911
strategy:
1012
matrix:
11-
node-version: [16.x]
13+
node-version:
14+
- 18.x
15+
ocaml-compiler:
16+
- 5.1.0
1217
os: [ubuntu-latest]
13-
1418
container:
15-
image: alexfedoseev/alpine-node-yarn-esy:0.0.4
19+
image: ocaml/opam:alpine-ocaml-5.1-afl
1620

1721
steps:
1822
- 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 }}
2323

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
5428
run: |
29+
make install
5530
npm ci --no-optional --ignore-scripts
56-
esy test
57-
esy release-static
5831
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
6434

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
10139

102-
- name: test-native
103-
run: |
104-
esy b dune runtest -f
40+
- name: Snapshot Tests
41+
run: make snapshot-tests
10542
env:
10643
CI: true
10744

108-
- name: npm ci
109-
if: runner.os != 'Windows'
110-
run: |
111-
npm ci --no-optional
45+
- name: Release Static
11246
env:
11347
GRAPHQL_CI: true
48+
run: make release-static
11449

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)
12151
uses: actions/upload-artifact@master
12252
with:
12353
name: ${{ matrix.os }}
12454
path: _build/default/src/bin/bin.exe
12555

12656
publish:
127-
needs: [test_and_build, test_and_build_linux]
57+
needs: [test_and_build]
12858
name: (only on release) Publish
12959
runs-on: ubuntu-latest
13060
steps:
13161
- uses: actions/checkout@v1
13262
- uses: actions/setup-node@v1
13363
with:
134-
node-version: "12.x"
64+
node-version: "18.x"
13565
registry-url: "https://registry.npmjs.org"
13666

13767
- name: Download linux artifacts

.github/workflows/print_esy_cache.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,26 @@ install: ## Install development dependencies
2323
opam update
2424
opam install -y . --deps-only --with-test
2525

26+
.PHONY: native-tests
27+
native-tests: ## Run native tests
28+
$(DUNE) runtest -f
29+
30+
.PHONY: snapshot-tests
31+
snapshot-tests: ## Run snapshot tests
32+
./tests.sh
33+
2634
.PHONY: test
2735
test: ## Run tests using yest
28-
$(DUNE) build
29-
./tests.sh
36+
make native-tests
37+
make snapshot-tests
3038

3139
.PHONY: build
3240
build: ## Build the project
3341
$(DUNE) build
3442

35-
.PHONY: release_static
36-
release_static: ## Release the project
37-
$(DUNE) build --root . --only-packages '#{self.name}' --ignore-promoted-rules --no-config --profile release-static
43+
.PHONY: release-static
44+
release-static: ## Release the project
45+
$(DUNE) build --root . --only-packages ${project_name} --ignore-promoted-rules --no-config --profile release-static
3846

3947
.PHONY: build_verbose
4048
build_verbose: ## Build the project

yarn.lock

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)