Merge pull request #308 from nberth/fixing-drom-n-opam-cross #1
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
name: Main Workflow | |
# use fields.git-main-branch to change from master | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
ocaml-compiler: | |
- 4.14.1 | |
skip_test: | |
- false | |
include: | |
- os: ubuntu-latest | |
ocaml-compiler: 4.14.0 | |
skip_test: true | |
runs-on: ${{ matrix.os }} | |
# use fields.github-workflow-env to add something here | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Retrieve opam cache | |
uses: actions/cache@v2 | |
id: cache-opam | |
with: | |
path: ~/.opam | |
key: v2-${{ runner.os }}-superbol-studio-oss-${{ matrix.ocaml-compiler }}-${{ hashFiles('opam/*.opam') }} | |
# restore-keys: | | |
# v2-${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}- | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: avsm/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
opam-pin: false | |
opam-depext: false | |
- name: Set git user | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
# use fields.opam-repo = "git+https://" to add an 'extra' opam repository | |
- run: opam pin add . -y --no-action | |
- run: opam depext -y superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser | |
# if: steps.cache-opam.outputs.cache-hit != 'true' | |
- run: opam install -y opam/*.opam --deps-only --with-test | |
# if: steps.cache-opam.outputs.cache-hit != 'true' | |
# - run: opam upgrade --fixup | |
# if: steps.cache-opam.outputs.cache-hit == 'true' | |
# Use fields.build-scripts to add more scripts to convert here | |
- run: dos2unix scripts/*.sh | |
if: matrix.os == 'windows-latest' | |
# Use fields.github-workflow-before-build to add something here | |
- run: git submodule init | |
- run: git submodule update | |
- run: make build | |
# Use fields.github-workflow-after-build to add something here | |
- name: check package.json | |
run: make check-package.json | |
- name: install test dependencies | |
if: matrix.skip_test != 'true' | |
run: make dev-deps | |
- name: run test suite | |
run: make test | |
if: matrix.skip_test != 'true' | |
- name: show test result on failure | |
if: failure() | |
run: cat _build/_autofonce/results.log | |
# Use fields.github-workflow-after-test to add something here | |
- name: test source is well formatted | |
run: make fmt | |
continue-on-error: true | |
if: matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest' | |
- name: build-doc | |
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt install -yqq python3-sphinx python3-sphinx-rtd-theme | |
opam install -y dune odoc | |
make doc | |
touch _drom/docs/.nojekyll | |
touch _drom/docs/sphinx/.nojekyll | |
touch _drom/docs/doc/.nojekyll | |
- name: deploy-doc | |
uses: JamesIves/[email protected] | |
if: github.ref == 'refs/heads/master' && matrix.ocaml-compiler == '4.14.1' && matrix.os == 'ubuntu-latest' | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: _drom/docs/ | |
CLEAN: true | |
# Use fields.github-workflow-trailer to add a trailer here | |