Skip to content

CI: badge test

CI: badge test #75

Workflow file for this run

name: Build examples and test all
on:
pull_request:
branches: ["main"]
push:
branches:
- ci-test/*
workflow_dispatch:
permissions:
contents: read
env:
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
GITHUB_API_VERSION: 2022-11-28
jobs:
build-test:
strategy:
fail-fast: false
matrix:
target:
[
x86_64-linux,
aarch64-linux,
x86_64-macos,
aarch64-macos,
x86_64-windows,
]
include:
- target: x86_64-linux
runs-on: ubuntu-latest
GIST_ID: 4ee5d4664cddf8c4c3b5d08d2b019005
- target: aarch64-linux
runs-on: ubuntu-24.04-arm
GIST_ID: 150025a7223f80c8a8c91e6e058514b3
- target: x86_64-macos
runs-on: macos-13
GIST_ID: 7b70bda23bc984a837589e779117cfbc
- target: aarch64-macos
runs-on: macos-latest
GIST_ID: 585827cfa91f653738dd0893ba65eb93
- target: x86_64-windows
runs-on: windows-latest
GIST_ID: 8480c9aab4afcd027dd32a7f36ecd539
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: 0.14.0
- name: Checkout
uses: actions/checkout@v4
- name: Build examples
run: zig build examples -Dtarget=${{ matrix.target }}
- name: Test
run: zig build test -Dtarget=${{ matrix.target }}
- name: Prepare badge
if: always()
shell: bash
run: |
MESSAGE="${{ matrix.target }} ${{ job.status }}"
echo MESSAGE="$MESSAGE" >> $GITHUB_ENV
COLOR=$([ ${{ job.status }} = "success" ] && echo "brightgreen" || echo "red")
echo COLOR="$COLOR" >> $GITHUB_ENV
- name: Update badge
if: always()
uses: colinparsonsme/upload-status-badge@v0
with:
auth: ${{ secrets.GIST_TOKEN }}
gist-id: ${{ matrix.GIST_ID }}
badge-label: ${{ env.MESSAGE }}
custom-message: test
custom-color: ${{ env.COLOR }}