[update] goto-bus-step/setup-zig -> mlugg/setup-zig #123
Workflow file for this run
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
name: ci | |
on: | |
pull_request: | |
branches: | |
- trunk | |
jobs: | |
ping: | |
permissions: | |
contents: write | |
strategy: | |
max-parallel: 3 | |
matrix: | |
repo: | |
- toolbox | |
- vulkan.zig | |
- wayland.zig | |
- X11.zig | |
- glfw.zig | |
- cimgui.zig | |
- spirv.zig | |
- glslang.zig | |
- shaderc.zig | |
- spaceporn | |
- spaceporn-action-env | |
- spaceporn-action-bot | |
- spaceporn-action-ci | |
- spaceporn-action-cd-ping | |
- spaceporn-action-cd-pong | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: "${{ github.repository_owner }}/${{ github.event.repository.name }}" | |
- name: Search current tag selected by the ping receiver | |
id: used | |
env: | |
FROM: "${{ github.repository_owner }}/${{ matrix.repo }}" | |
shell: bash | |
run: | | |
tag="$(grep -h -o -R "${FROM}@v\S\+" | sed "s#^${FROM}@##" | sort -u || :)" | |
printf 'tag=%s\n' "${tag}" >> "${GITHUB_OUTPUT}" | |
- uses: actions/checkout@v4 | |
with: | |
repository: "${{ github.repository_owner }}/${{ matrix.repo }}" | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Prepare dump | |
id: prepare | |
env: | |
USED: "${{ steps.used.outputs.tag }}" | |
shell: bash | |
run: | | |
tags="$(git tag --points-at "$(git describe --tags --abbrev=0 2> /dev/null)" 2> /dev/null | wc -l || :)" | |
if [[ "${tags}" == '1' ]]; then tag="$(git describe --tags --abbrev=0)"; fi | |
git show-ref --tags "${tag:-"${USED}"}" | |
git checkout "${tag:-"${USED}"}" | |
printf 'tag=%s\n' "${tag:-"${USED}"}" >> "${GITHUB_OUTPUT}" | |
if [[ -f "${GITHUB_WORKSPACE}/build.zig" ]] | |
then | |
printf 'is_composite=false\n' >> "${GITHUB_OUTPUT}" | |
else | |
printf 'is_composite=true\n' >> "${GITHUB_OUTPUT}" | |
fi | |
- uses: actions/checkout@v4 | |
- name: Keep the last run ID in memory | |
id: previous_run | |
env: | |
GH_TOKEN: "${{ github.token }}" | |
TITLE: "dump-from-${{ matrix.repo }}" | |
WORKFLOW_NAME: 'dump' | |
shell: bash | |
run: | | |
id="$(gh run list -w "${WORKFLOW_NAME}" -L 100 --json 'databaseId,displayTitle' --jq "[.[] | select(.displayTitle | contains (\"${TITLE}\")) | .databaseId] | sort | .[-1]")" | |
printf 'id=%s\n' "${id}" >> "${GITHUB_OUTPUT}" | |
- uses: ./ | |
with: | |
from: "${{ matrix.repo }}" | |
is_composite: "${{ steps.prepare.outputs.is_composite }}" | |
event: 'dump' | |
to: "${{ github.event.repository.name }}" | |
tag: "${{ steps.prepare.outputs.tag }}" | |
token: "${{ secrets.PAT }}" | |
- uses: actions/checkout@v4 | |
- name: Wait for the new job to start | |
id: start | |
env: | |
GH_TOKEN: "${{ github.token }}" | |
PREVIOUS_RUN_ID: "${{ steps.previous_run.outputs.id }}" | |
TITLE: "dump-from-${{ matrix.repo }}" | |
WORKFLOW_NAME: 'dump' | |
shell: bash | |
run: | | |
while [[ -z "${id:-}" || "${id:-}" == "${PREVIOUS_RUN_ID}" ]] | |
do | |
sleep 2 | |
id="$(gh run list -w "${WORKFLOW_NAME}" -L 100 --json 'databaseId,displayTitle' --jq "[.[] | select(.displayTitle | contains (\"${TITLE}\")) | .databaseId] | sort | .[-1]")" | |
done | |
printf 'job_id=%s\n' "${id}" >> "${GITHUB_OUTPUT}" | |
- name: Wait for the new job to end | |
id: end | |
env: | |
CONCLUSION: 'conclusion' | |
GH_TOKEN: "${{ github.token }}" | |
ID: "${{ steps.start.outputs.job_id }}" | |
STATUS: 'status' | |
shell: bash | |
run: | | |
while [[ "${status:-}" != 'completed' ]] | |
do | |
sleep 2 | |
status="$(gh run view --json "${STATUS}" "${ID}" --jq ".${STATUS}")" | |
done | |
conclusion="$(gh run view --json "${CONCLUSION}" "${ID}" --jq ".${CONCLUSION}")" | |
printf 'job_result=%s\n' "${conclusion}" >> "${GITHUB_OUTPUT}" | |
- name: Fail if the dump failed | |
env: | |
RESULT: "${{ steps.end.outputs.job_result }}" | |
shell: bash | |
run: | | |
[[ "${RESULT}" == 'success' ]] |