Skip to content

Merge pull request #34 from dafyddj/chore/copier #198

Merge pull request #34 from dafyddj/chore/copier

Merge pull request #34 from dafyddj/chore/copier #198

Workflow file for this run

name: Build boxes
on:
pull_request:
push:
schedule:
- cron: 4 15 * * 6
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
should-run:
name: Should run
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
should-run: ${{ steps.action.outputs.should-run }}
steps:
- id: action
uses: dafyddj/should-workflow-run@v1
pre-commit:
name: Run `pre-commit`
needs: should-run
if: fromJSON(needs.should-run.outputs.should-run)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
gbt:
name: Get build types
needs: pre-commit
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
build-types: ${{ steps.get-build-types.outputs.build-types }}
steps:
- uses: actions/checkout@v4
- id: get-build-types
run: |
BUILDS=$(jq -cR 'split(" ")' builds)
OUTPUT="build-types=$BUILDS"
echo "Setting '$OUTPUT'"
echo "$OUTPUT" >> $GITHUB_OUTPUT
gov:
name: Get OS versions
needs: pre-commit
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
os-versions: ${{ steps.get-os-versions.outputs.os-versions }}
steps:
- uses: actions/checkout@v4
- id: get-os-versions
run: |
VERSIONS=$(jq -cR 'split(" ")' os_vers)
OUTPUT="os-versions=$VERSIONS"
echo "Setting '$OUTPUT'"
echo "$OUTPUT" >> $GITHUB_OUTPUT
build-boxes:
needs:
- gbt
- gov
uses: ./.github/workflows/libbuild.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
build-os-version: ${{ fromJSON(needs.gov.outputs.os-versions) }}
build-runner: [buildjet-2vcpu-ubuntu-2204, virtualbox]
build-type: ${{ fromJSON(needs.gbt.outputs.build-types) }}
exclude:
- build-type: qemu-x64
build-runner: virtualbox
- build-type: vbox-x64
build-runner: buildjet-2vcpu-ubuntu-2204
with:
build-os-version: ${{ matrix.build-os-version }}
build-runner: ${{ matrix.build-runner }}
build-type: ${{ matrix.build-type }}
timeout-minutes: 20
results:
name: Collect results
needs:
- build-boxes
runs-on: ubuntu-latest
steps:
- run: echo "Builds succeeded!"
- name: Update Healthchecks.io
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
run: curl -fsS -m 10 --retry 5 -o /dev/null https://hc-ping.com/${HC_UUID}
env:
HC_UUID: ${{ secrets.HC_UUID }}