.github/workflows/testing.yml: copy Docs secret into docker volume #466
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
# This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0 | |
# Linting: xclip -sel c <.github/workflows/testing.yml # https://rhysd.github.io/actionlint/ | |
on: | |
push: | |
branches: [ 'trunk', 'next', 'wip/**' ] | |
# tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ] | |
pull_request: | |
branches: [ 'trunk', 'next' ] | |
jobs: | |
FocalAssets: | |
runs-on: ubuntu-latest | |
env: { CITAG: "focal" } | |
steps: | |
- { uses: actions/[email protected], with: { fetch-depth: 0 } } # Fix actions/checkout#290 | |
- run: git fetch -f --tags && git submodule update --init --recursive && git describe | |
- { uses: actions/cache@v4, with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } } | |
- run: | | |
misc/cirun build "/tmp/cicache" | |
- name: 'Configure build presets' | |
run: | | |
echo -e ' prefix=/\n CC=clang \n CXX=clang++ \n CLANG_TIDY=clang-tidy ' > config-defaults.mk | |
misc/cirun dir2vol . ;# copy current git to /cirun | |
- name: 'Build Dist Assets' | |
run: | | |
misc/cirun make mkassets | |
misc/cirun vol2dir . ;# move /cirun out of docker volume | |
- uses: actions/upload-artifact@v4 | |
with: { name: assets, path: assets/ } | |
- uses: actions/upload-artifact@v4 | |
with: { name: dist-tarball, path: assets/*.tar* } | |
UploadDocs: | |
if: ${{ github.repository == 'tim-janik/anklang' && github.ref == 'refs/heads/trunk' }} | |
runs-on: ubuntu-latest | |
env: { CITAG: "focal" } | |
steps: | |
- { uses: actions/[email protected], with: { fetch-depth: 0 } } # Fix actions/checkout#290 | |
- run: git fetch -f --tags && git submodule update --init --recursive && git describe | |
- { uses: actions/cache@v4, with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } } | |
- run: | | |
misc/cirun build "/tmp/cicache" | |
- name: 'Configure build presets' | |
run: | | |
echo -e ' prefix=/\n CC=clang \n CXX=clang++ \n CLANG_TIDY=clang-tidy ' > config-defaults.mk | |
(umask 0077 && cat <<< "${{ secrets.SSH_ID_GHDOCS4ANKLANG_ECDSA }}" > .git/.ssh_id_ghdocs4anklang) | |
misc/cirun dir2vol . ;# copy current git to /cirun | |
- name: 'Upload API Docs' # http://tim-janik.github.io/docs/anklang | |
run: | | |
misc/cirun make -j`nproc` all | |
misc/cirun doc/poxy.sh -b -u | |
ArchReplay: | |
runs-on: ubuntu-latest | |
env: { CITAG: "arch" } | |
steps: | |
- { uses: actions/[email protected], with: { fetch-depth: 0 } } # Fix actions/checkout#290 | |
- run: git fetch -f --tags && git submodule update --init --recursive && git describe | |
- { uses: actions/cache@v4, with: { path: "/tmp/cicache", key: "ciarch-${{hashFiles ('misc/Dockerfile.arch')}}" } } | |
- run: | | |
misc/cirun build "/tmp/cicache" | |
- name: 'Configure build presets' | |
run: | | |
echo 'prefix=/' > config-defaults.mk ;# reset any previous config-defaults.mk | |
misc/cirun dir2vol . ;# copy current git to /cirun | |
- name: 'Build Anklang' | |
run: | | |
misc/cirun make GCC_COLORS="" -j`nproc` all | |
- name: 'Run Tests' | |
run: | | |
misc/cirun make -j`nproc` check | |
- name: 'Run X11 GUI Tests' | |
run: | | |
misc/cirun make x11test-v | |
misc/cirun vol2dir . ;# move /cirun out of docker volume | |
# Artifact upload from x11test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: { name: "x11test", path: "out/x11test/" } | |
FocalClangTidy: | |
if: ${{ ! contains(github.ref, 'refs/tags/') }} | |
runs-on: ubuntu-latest | |
env: { CITAG: "focal" } | |
steps: | |
- { uses: actions/[email protected], with: { fetch-depth: 0 } } # Fix actions/checkout#290 | |
- run: git fetch -f --tags && git submodule update --init --recursive && git describe | |
- { uses: actions/cache@v4, with: { path: "/tmp/cicache", key: "cifocal-${{hashFiles ('misc/Dockerfile.focal')}}" } } | |
- run: | | |
misc/cirun build "/tmp/cicache" | |
- name: 'Configure build presets' | |
run: | | |
echo -e ' prefix=/\n CC=clang \n CXX=clang++ \n CLANG_TIDY=clang-tidy ' > config-defaults.mk | |
misc/cirun dir2vol . ;# copy current git to /cirun | |
- run: | | |
misc/cirun make -j`nproc` all | |
- run: | | |
misc/cirun make -j`nproc` check | |
- name: 'Make clang-tidy' | |
run: | | |
misc/cirun make -j`nproc` clang-tidy | |
# Artifact upload from clang-tidy | |
- uses: actions/upload-artifact@v4 | |
with: { name: clang-tidy, path: out/clang-tidy/ } | |
- name: 'Make branch-check' | |
# Use non-0 exit status for a failing branch-check on PRs | |
run: | | |
test -z "${{ github.event.pull_request }}" || BRANCH_CHECK_EXIT=77 | |
misc/cirun make branch-check BRANCH_CHECK_EXIT=$BRANCH_CHECK_EXIT | |
Ping-IRC: | |
if: ${{ always() }} | |
needs: [FocalAssets, UploadDocs, ArchReplay, FocalClangTidy] | |
runs-on: ubuntu-latest | |
steps: | |
- { uses: actions/[email protected], with: { fetch-depth: 0 } } # Fix actions/checkout#290 | |
- run: git fetch -f --tags && git submodule update --init --recursive && git describe | |
- name: Check Jobs | |
run: | | |
echo '${{ needs.FocalAssets.result }}' '${{ needs.UploadDocs.result }}' '${{ needs.ArchReplay.result }}' '${{ needs.FocalClangTidy.result }}' | |
[[ ${{ needs.FocalAssets.result }} =~ success|skipped ]] | |
[[ ${{ needs.UploadDocs.result }} =~ success|skipped ]] | |
[[ ${{ needs.ArchReplay.result }} =~ success|skipped ]] | |
[[ ${{ needs.FocalClangTidy.result }} =~ success|skipped ]] | |
- name: Ping IRC | |
if: always() | |
run: | | |
R='${{ github.repository }}' && R=${R#*/} | |
B='${{ github.ref }}' && B=${B#refs/heads/} | |
S='${{ job.status }}' && URL='${{ github.event.head_commit.url }}' | |
A='${{ github.actor }}' && B="$(git branch --show-current)" | |
MSG=$(git log -1 --format='%s') | |
.github/workflows/ircbot.py -q -j "#Anklang" -R "$R" -U "$A" -D "$B" -S "$S" "$MSG" "$URL" |