forked from ocaml/ocaml-lsp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Github Actions workflow (ocaml#318)
* Improve Actions workflow Signed-off-by: Sora Morimoto <[email protected]> * Improve Makefile * Generate lock files * Update CI with Makefile and lockfiles * Run dune-release in opam sandbox * Add caching, save build minutes and the planet * Remove unused files * Make CI build for 4.11.1 Co-authored-by: Sora Morimoto <[email protected]>
- Loading branch information
Showing
10 changed files
with
294 additions
and
82 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,77 +1,97 @@ | ||
name: Build and Test | ||
|
||
on: | ||
- push | ||
- pull_request | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build and Test | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
skip_test: | ||
- false | ||
ocaml-version: | ||
- 4.11.0 | ||
include: | ||
- ocaml-version: 4.11.0 | ||
os: windows-latest | ||
skip_test: true | ||
- ocaml-version: 4.10.0 | ||
os: windows-latest | ||
skip_test: true | ||
- ocaml-version: 4.09.1 | ||
os: ubuntu-latest | ||
skip_test: true | ||
- ocaml-version: 4.06.1 | ||
os: ubuntu-latest | ||
skip_test: true | ||
- windows-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
SKIP_TEST: ${{ matrix.skip_test }} | ||
ocaml-version: | ||
- 4.11.1 | ||
- 4.10.1 | ||
- 4.09.1 | ||
- 4.08.1 | ||
- 4.07.1 | ||
- 4.06.1 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Retrieve opam cache | ||
uses: actions/cache@v2 | ||
if: runner.os != 'Windows' | ||
id: cache-opam | ||
with: | ||
path: ~/.opam | ||
key: v1-${{ runner.os }}-opam-${{ matrix.ocaml-version }}-${{ hashFiles('*.opam.locked') }} | ||
restore-keys: | | ||
v1-${{ runner.os }}-opam-${{ matrix.ocaml-version }}- | ||
- name: Use latest LTS Node.js release | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
node-version: 14.x | ||
|
||
- name: Use OCaml ${{ matrix.ocaml-version }} | ||
uses: avsm/setup-ocaml@v1 | ||
with: | ||
ocaml-version: ${{ matrix.ocaml-version }} | ||
|
||
- run: opam pin -n . | ||
- name: Print OCaml version | ||
run: opam exec -- ocaml --version | ||
|
||
- run: opam install -t . --deps-only | ||
if: env.SKIP_TEST != 'true' | ||
- name: Pin local packages | ||
run: | | ||
opam pin jsonrpc.dev . --no-action | ||
opam pin lsp.dev . --no-action | ||
opam pin ocaml-lsp-server.dev . --no-action | ||
- run: opam install . --deps-only | ||
if: env.SKIP_TEST == 'true' | ||
- name: Install OCaml secondary compiler | ||
if: steps.cache-opam.outputs.cache-hit != 'true' && runner.os != 'Windows' && (matrix.ocaml-version == '4.06.1' || matrix.ocaml-version == '4.07.1') | ||
run: opam install ocamlfind-secondary | ||
|
||
- run: opam exec -- make test | ||
if: env.SKIP_TEST != 'true' | ||
- name: Install Opam dependencies | ||
if: steps.cache-opam.outputs.cache-hit != 'true' | ||
run: | | ||
opam install . --with-doc --with-test --locked --ignore-constraints-on=ocaml | ||
opam install ocamlformat --skip-updates | ||
- name: test source is well formatted | ||
run: opam exec -- make fmt | ||
if: env.OCAML_VERSION == '4.10.0' && env.OS == 'ubuntu-latest' | ||
- name: Fix broken opam state | ||
if: steps.cache-opam.outputs.cache-hit == 'true' | ||
run: opam upgrade --fixup | ||
|
||
- run: yarn --frozen-lockfile | ||
- name: Install Node dependencies | ||
working-directory: ocaml-lsp-server/test/e2e | ||
if: env.SKIP_TEST != 'true' | ||
run: | | ||
yarn --frozen-lockfile | ||
- name: Build | ||
run: opam exec -- make build | ||
|
||
- name: Check formatting | ||
if: matrix.ocaml-version == '4.11.1' && runner.os == 'Linux' | ||
run: opam exec -- make fmt | ||
|
||
- name: Run OCaml tests | ||
run: opam exec -- make test | ||
|
||
- run: opam exec -- yarn test | ||
- name: Run Node tests | ||
working-directory: ocaml-lsp-server/test/e2e | ||
if: env.SKIP_TEST != 'true' | ||
run: opam exec -- dune exec -- yarn test |
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
opam-version: "2.0" | ||
name: "jsonrpc" | ||
version: "dev" | ||
synopsis: "Jsonrpc protocol implemenation" | ||
description: "See https://www.jsonrpc.org/specification" | ||
maintainer: "Rudi Grinberg <[email protected]>" | ||
authors: [ | ||
"Andrey Popp <[email protected]>" | ||
"Rusty Key <[email protected]>" | ||
"Louis Roché <[email protected]>" | ||
"Oleksiy Golovko <[email protected]>" | ||
"Rudi Grinberg <[email protected]>" | ||
"Sacha Ayoun <[email protected]>" | ||
"cannorin <[email protected]>" | ||
] | ||
license: "ISC" | ||
homepage: "https://github.com/ocaml/ocaml-lsp" | ||
bug-reports: "https://github.com/ocaml/ocaml-lsp/issues" | ||
depends: [ | ||
"base-bigarray" {= "base"} | ||
"base-threads" {= "base"} | ||
"base-unix" {= "base"} | ||
"biniou" {= "1.2.1"} | ||
"cppo" {= "1.6.6"} | ||
"dune" {= "2.7.1"} | ||
"easy-format" {= "1.3.2"} | ||
"ocaml" {= "4.11.1"} | ||
"ocaml-config" {= "1"} | ||
"ocaml-syntax-shims" {= "1.0.0"} | ||
"ocaml-system" {= "4.11.1"} | ||
"ppx_yojson_conv_lib" {= "v0.14.0"} | ||
"result" {= "1.5"} | ||
"stdlib-shims" {= "0.1.0"} | ||
"yojson" {= "1.7.0"} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
["ocaml" "unix.cma" "unvendor.ml"] | ||
["dune" "build" "-p" name "-j" jobs "@install" "@doc" {with-doc}] | ||
] | ||
dev-repo: "git+https://github.com/ocaml/ocaml-lsp.git" |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
opam-version: "2.0" | ||
name: "lsp" | ||
version: "dev" | ||
synopsis: "LSP protocol implementation in OCaml" | ||
description: """ | ||
Implementation of the LSP protocol in OCaml. It is designed to be as portable as | ||
possible and does not make any assumptions about IO.""" | ||
maintainer: "Rudi Grinberg <[email protected]>" | ||
authors: [ | ||
"Andrey Popp <[email protected]>" | ||
"Rusty Key <[email protected]>" | ||
"Louis Roché <[email protected]>" | ||
"Oleksiy Golovko <[email protected]>" | ||
"Rudi Grinberg <[email protected]>" | ||
"Sacha Ayoun <[email protected]>" | ||
"cannorin <[email protected]>" | ||
] | ||
license: "ISC" | ||
homepage: "https://github.com/ocaml/ocaml-lsp" | ||
bug-reports: "https://github.com/ocaml/ocaml-lsp/issues" | ||
depends: [ | ||
"base" {= "v0.14.0" & with-test} | ||
"base-bigarray" {= "base"} | ||
"base-threads" {= "base"} | ||
"base-unix" {= "base"} | ||
"biniou" {= "1.2.1"} | ||
"cinaps" {= "v0.14.0" & with-test} | ||
"cmdliner" {= "1.0.4"} | ||
"conf-m4" {= "1"} | ||
"cppo" {= "1.6.6"} | ||
"csexp" {= "1.3.2"} | ||
"dune" {= "2.7.1"} | ||
"dune-configurator" {= "2.7.1" & with-test} | ||
"easy-format" {= "1.3.2"} | ||
"jane-street-headers" {= "v0.14.0" & with-test} | ||
"jsonrpc" {= "dev"} | ||
"jst-config" {= "v0.14.0" & with-test} | ||
"menhir" {= "20201122" & with-test} | ||
"menhirLib" {= "20201122" & with-test} | ||
"menhirSdk" {= "20201122" & with-test} | ||
"ocaml" {= "4.11.1"} | ||
"ocaml-compiler-libs" {= "v0.12.3" & with-test} | ||
"ocaml-config" {= "1"} | ||
"ocaml-migrate-parsetree" {= "2.1.0" & with-test} | ||
"ocaml-syntax-shims" {= "1.0.0"} | ||
"ocaml-system" {= "4.11.1"} | ||
"ocamlbuild" {= "0.14.0"} | ||
"ocamlfind" {= "1.8.1"} | ||
"octavius" {= "1.2.2" & with-test} | ||
"ppx_assert" {= "v0.14.0" & with-test} | ||
"ppx_base" {= "v0.14.0" & with-test} | ||
"ppx_cold" {= "v0.14.0" & with-test} | ||
"ppx_compare" {= "v0.14.0" & with-test} | ||
"ppx_derivers" {= "1.2.1" & with-test} | ||
"ppx_enumerate" {= "v0.14.0" & with-test} | ||
"ppx_expect" {= "v0.14.1" & with-test} | ||
"ppx_hash" {= "v0.14.0" & with-test} | ||
"ppx_here" {= "v0.14.0" & with-test} | ||
"ppx_inline_test" {= "v0.14.1" & with-test} | ||
"ppx_js_style" {= "v0.14.0" & with-test} | ||
"ppx_optcomp" {= "v0.14.1" & with-test} | ||
"ppx_sexp_conv" {= "v0.14.2" & with-test} | ||
"ppx_yojson_conv_lib" {= "v0.14.0"} | ||
"ppxlib" {= "0.20.0" & with-test} | ||
"re" {= "1.9.0" & with-test} | ||
"result" {= "1.5"} | ||
"seq" {= "base" & with-test} | ||
"sexplib0" {= "v0.14.0" & with-test} | ||
"stdio" {= "v0.14.0" & with-test} | ||
"stdlib-shims" {= "0.1.0"} | ||
"time_now" {= "v0.14.0" & with-test} | ||
"topkg" {= "1.0.3"} | ||
"uchar" {= "0.0.2"} | ||
"uutf" {= "1.0.2"} | ||
"yojson" {= "1.7.0"} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
["ocaml" "unix.cma" "unvendor.ml"] | ||
["dune" "build" "-p" name "-j" jobs "@install" "@doc" {with-doc}] | ||
] | ||
dev-repo: "git+https://github.com/ocaml/ocaml-lsp.git" |
Oops, something went wrong.