Skip to content

build

build #173

Workflow file for this run

# 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 || :