Skip to content

Commit

Permalink
💚 - Fix CI Build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Peelen committed Jan 19, 2024
1 parent dd21527 commit d0fc995
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 124 deletions.
117 changes: 24 additions & 93 deletions .github/workflows/pipeline.yml
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
Expand All @@ -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
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/print_esy_cache.js

This file was deleted.

18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,26 @@ install: ## Install development dependencies
opam update
opam install -y . --deps-only --with-test

.PHONY: native-tests
native-tests: ## Run native tests
$(DUNE) runtest -f

.PHONY: snapshot-tests
snapshot-tests: ## Run snapshot tests
./tests.sh

.PHONY: test
test: ## Run tests using yest
$(DUNE) build
./tests.sh
make native-tests
make snapshot-tests

.PHONY: build
build: ## Build the project
$(DUNE) build

.PHONY: release_static
release_static: ## Release the project
$(DUNE) build --root . --only-packages '#{self.name}' --ignore-promoted-rules --no-config --profile release-static
.PHONY: release-static
release-static: ## Release the project
$(DUNE) build --root . --only-packages ${project_name} --ignore-promoted-rules --no-config --profile release-static

.PHONY: build_verbose
build_verbose: ## Build the project
Expand Down
13 changes: 0 additions & 13 deletions yarn.lock

This file was deleted.

0 comments on commit d0fc995

Please sign in to comment.