Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 37 additions & 55 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: graphql-ppx-pipeline

on: [pull_request, push]

permissions: read-all

jobs:
test_and_build_linux:
name: ${{ matrix.os }}/node-${{ matrix.node-version }}
Expand All @@ -10,9 +12,7 @@ jobs:
matrix:
node-version: [16.x]
os: [ubuntu-latest]

container:
image: alexfedoseev/alpine-node-yarn-esy:0.0.4
ocaml-compiler: ["5.1"]

steps:
- uses: actions/checkout@v1
Expand All @@ -21,30 +21,19 @@ 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
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }}
restore-keys: |
${{ matrix.os }}-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
opam-local-packages: |
ocaml-option-static

- run: opam install . --deps-only --with-test

- name: build
run: esy b
- run: opam exec -- dune build

- name: native tests
run: |
esy b dune runtest -f
run: opam exec -- dune runtest -f
env:
CI: true

Expand All @@ -53,8 +42,10 @@ jobs:
GRAPHQL_CI: true
run: |
npm ci --no-optional --ignore-scripts
esy test
esy release-static
./tests.sh

- name: Release build
run: opam exec -- dune build --root . --only-packages 'graphql_ppx' --ignore-promoted-rules --no-config --profile release

- name: (only on release) Upload artifacts ${{ matrix.os }}
uses: actions/upload-artifact@master
Expand All @@ -68,7 +59,8 @@ jobs:
strategy:
matrix:
node-version: [16.x]
os: [windows-latest, macOS-13, macOS-latest]
os: [macOS-13, macOS-latest]
ocaml-compiler: ["5.1"]

steps:
- uses: actions/checkout@v1
Expand All @@ -78,30 +70,17 @@ jobs:
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
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
path: ${{ steps.print_esy_cache.outputs.esy_cache }}
key: ${{ matrix.os }}-${{ hashFiles('**/index.json') }}
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: build
run: esy b
- run: opam install . --deps-only --with-test

- name: test-native
run: |
esy b dune runtest -f
- run: opam exec -- dune build

- name: native tests
run: opam exec -- dune runtest -f
env:
CI: true

Expand All @@ -115,7 +94,10 @@ jobs:
- name: snaphot tests
if: runner.os != 'Windows'
run: |
esy test
./tests.sh

- name: Release build
run: opam exec -- dune build --root . --only-packages 'graphql_ppx' --ignore-promoted-rules --no-config --profile release

- name: (only on release) Upload artifacts ${{ matrix.os }}
uses: actions/upload-artifact@master
Expand Down Expand Up @@ -155,20 +137,20 @@ jobs:
name: macOS-13
path: binaries/darwin

- name: Download windows artifacts
if: success()
uses: actions/download-artifact@master
with:
name: windows-latest
path: binaries/windows
# - name: Download windows artifacts
# if: success()
# uses: actions/download-artifact@master
# with:
# name: windows-latest
# path: binaries/windows

- name: Move artifacts
if: success()
run: |
mkdir -p bin
mv binaries/darwin/bin.exe bin/graphql-ppx-darwin-x64.exe
mv binaries/darwin-arm64/bin.exe bin/graphql-ppx-darwin-arm64.exe
mv binaries/windows/bin.exe bin/graphql-ppx-win-x64.exe
# mv binaries/windows/bin.exe bin/graphql-ppx-win-x64.exe
mv binaries/linux/bin.exe bin/graphql-ppx-linux-x64.exe

- name: Publish
Expand Down
4 changes: 2 additions & 2 deletions dune-workspace
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(lang dune 1.1)
(lang dune 2.0)

(env
(release-static
(flags
(:standard -ccopt -static)))
(:standard -static)))
(release
(flags (:standard))))
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down Expand Up @@ -95,9 +95,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down Expand Up @@ -147,9 +147,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down
Loading