add missing type constraint of variant constructor to lib_gen (#420) #168
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: Common CI workflow | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
ocaml-version: | |
- 5.1.x | |
## we only test all versions at the [all-variants] flow | |
node-version: | |
- lts/hydrogen # v18 Active LTS | |
if: github.repository == 'kxcinc/bindoj' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 2 | |
- name: Use OCaml ${{ matrix.ocaml-version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-version }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: yarn | |
cache-dependency-path: 'with_js/yarn.lock' | |
- name: Cache OPAM switch | |
id: cache-switch | |
uses: actions/cache@v3 | |
with: | |
path: _opam | |
key: v1-${{ runner.os }}-${{ matrix.ocaml-version }}-opam-switch | |
- name: check OCaml version and workspace info | |
run: ./scripts/ci_print_env.sh | |
- run: sudo ./scripts/ci_setup_ubuntu.sh | |
- name: Install dependencies | |
run: opam install . --deps-only --with-test --with-doc | |
- name: build | |
run: opam exec -- make gen | |
- name: check diff | |
run: | | |
GITHUB_STATUS_SHA="${{ github.event.pull_request.head.sha }}" | |
GITHUB_STATUS_SHA="${GITHUB_STATUS_SHA:=$GITHUB_SHA}" | |
git add *.opam | |
git add src/ | |
git add tooling/ | |
git add with_js/ | |
git add example/ | |
git diff --cached --exit-code && ( \ | |
curl --request POST \ | |
--url $GITHUB_API_URL/repos/${{ github.repository }}/statuses/$GITHUB_STATUS_SHA \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data '{ | |
"state": "success", | |
"context": "verify-built-artifact" | |
}' \ | |
--fail \ | |
) || ( \ | |
curl --request POST \ | |
--url $GITHUB_API_URL/repos/${{ github.repository }}/statuses/$GITHUB_STATUS_SHA \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data '{ | |
"state": "failure", | |
"context": "verify-built-artifact" | |
}' \ | |
--fail \ | |
) | |
- name: test with coverage | |
run: opam exec -- make _coverage | |
- name: doc | |
run: opam exec -- make _doc | |
- name: upload odoc generated document | |
if: ${{ matrix.os == 'ubuntu-latest' && matrix.ocaml-version == '4.13.1' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: odoc-html-${{ github.sha }} | |
path: _build/default/_doc/_html/ | |
# doc deployment temporarily disabled | |
# # https://github.com/amondnet/vercel-action/issues/170 が解決したら最新のタグに更新 | |
# - uses: amondnet/vercel-action@1d26fa06fdab094080b48d33eea2031cee54724d | |
# if: github.ref != 'refs/heads/main' | |
# with: | |
# vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
# working-directory: ./ | |
# scope: "kxcinc" | |
# github-comment: true | |
# - uses: amondnet/vercel-action@1d26fa06fdab094080b48d33eea2031cee54724d | |
# if: github.ref == 'refs/heads/main' | |
# with: | |
# vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
# vercel-org-id: ${{ secrets.VERCEL_ORG_ID}} | |
# vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID}} | |
# working-directory: ./ | |
# scope: "kxcinc" | |
# vercel-args: '--prod' | |
# github-comment: true | |
setup-ocaml-checked: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "all set" |