2022-02-03 21:45:52 +03:00
|
|
|
name: Harness
|
2022-02-03 18:12:04 +03:00
|
|
|
|
|
|
|
on:
|
2022-02-04 14:23:34 +03:00
|
|
|
push:
|
2022-02-04 16:37:17 +03:00
|
|
|
branches: [master]
|
2022-02-04 14:23:34 +03:00
|
|
|
pull_request:
|
2022-02-03 18:12:04 +03:00
|
|
|
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
|
|
jobs:
|
|
|
|
run-make-all:
|
|
|
|
# The type of runner that the job will run on
|
|
|
|
runs-on: self-hosted
|
|
|
|
|
2022-08-01 20:56:04 +03:00
|
|
|
env:
|
|
|
|
IMAGE_TAG: ${{ github.head_ref || github.ref_name }}
|
|
|
|
|
2022-02-03 18:12:04 +03:00
|
|
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2023-02-28 19:26:49 +03:00
|
|
|
uses: actions/checkout@v3
|
2022-08-01 20:56:04 +03:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-07-18 18:08:46 +03:00
|
|
|
- name: Prepare container with all dependencies
|
|
|
|
run: git archive HEAD | docker build - --target dev-build-context
|
|
|
|
- name: Run builds, checks and tests
|
2022-08-01 20:56:04 +03:00
|
|
|
run: git archive HEAD | docker build - --force-rm -t catalalang/catala-build:${IMAGE_TAG}
|
2022-07-29 16:44:15 +03:00
|
|
|
- name: Cleanup Docker image
|
|
|
|
if: ${{ github.ref != 'refs/heads/master' }}
|
2022-08-01 20:56:04 +03:00
|
|
|
run: docker image rm catalalang/catala-build:${IMAGE_TAG}
|
|
|
|
- name: Build architecture-independent artifacts
|
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
run: |
|
|
|
|
RELEASE_TAG=$(git describe --tags)
|
|
|
|
mkdir -p artifacts
|
|
|
|
docker run --rm catalalang/catala-build:${IMAGE_TAG} sh -uexc '
|
2022-08-09 17:28:02 +03:00
|
|
|
opam --cli=2.1 remove z3 >&2
|
2022-08-01 20:56:04 +03:00
|
|
|
opam --cli=2.1 exec -- dune build --profile=release french_law compiler/catala.bc.js >&2
|
|
|
|
mv _build/default/compiler/catala.bc.js catala_'"${RELEASE_TAG}"'_node.js >&2
|
2023-03-01 15:50:36 +03:00
|
|
|
tar c -h catala_'"${RELEASE_TAG}"'_node.js doc/syntax/syntax.pdf french_law --exclude french_law/js/node_modules --exclude french_law/python/env --exclude '"'"'.*'"'"' --exclude '"'"'__*'"'"'
|
2022-08-01 20:56:04 +03:00
|
|
|
' | tar vx -C artifacts
|
|
|
|
- name: Build static binaries
|
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
run: ./build_release.sh -C artifacts
|
|
|
|
- name: Publish artifacts
|
|
|
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: Catala artifacts
|
|
|
|
path: artifacts/*
|