build #173
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
# GitHub workflow for testing the build, | |
# including installation, the test suite and the documentation. | |
# - This workflow runs on a schedule, and only if | |
# the GitHub secret SCHEDULE_BUILD is set to True. | |
# - We do not include further testing as this workflow | |
# runs on GitHub which has a job time limit of 6 hours. | |
name: build | |
on: | |
schedule: | |
- cron: '0 0 * * SUN' # Weekly, Sundays at 00:00 | |
jobs: | |
check_schedule: | |
runs-on: ubuntu-22.04 | |
outputs: | |
scheduled: ${{ steps.check_schedule.outputs.scheduled }} | |
steps: | |
- name: π Check schedule | |
id: check_schedule | |
env: | |
schedule_build: ${{ secrets.SCHEDULE_BUILD }} | |
run: | | |
if [ "${schedule_build}" == "True" ]; then | |
echo "Build scheduled" | |
echo "scheduled=1" >> "${GITHUB_OUTPUT}" | |
else | |
echo "Build not scheduled" | |
fi | |
build: | |
runs-on: ubuntu-22.04 | |
needs: check_schedule | |
if: needs.check_schedule.outputs.scheduled | |
steps: | |
- name: ποΈ Checkout | |
uses: actions/checkout@v4 | |
- name: π Clean dangling Docker containers and images | |
uses: ./.github/actions/docker-clean | |
with: | |
imgpat: "concept:latest" | |
- name: π Set temporary Docker image name | |
run: | | |
echo "docker_image=concept:latest__$(date +%s)" >> "${GITHUB_ENV}" | |
- name: π§ Install | |
run: | | |
docker build \ | |
-t ${docker_image} \ | |
--force-rm \ | |
--no-cache \ | |
--pull \ | |
. | |
- name: π€ Run test suite | |
run: | | |
sleep 1 | |
docker run \ | |
-e make_jobs="-j 1" \ | |
--name "${GITHUB_REPOSITORY//\//_}__${GITHUB_WORKFLOW}__${GITHUB_JOB}__$(date +%s)" \ | |
--rm ${docker_image} \ | |
concept -t all | |
- name: π Build documentation | |
run: | | |
sleep 1 | |
docker run \ | |
--name "${GITHUB_REPOSITORY//\//_}__${GITHUB_JOB}__$(date +%s)" \ | |
--rm \ | |
${docker_image} \ | |
bash -c 'make clean-doc && make doc' | |
- name: π Remove temporary Docker image | |
run: | | |
docker rmi -f ${docker_image} 2>/dev/null || : | |