Skip to content

ci: update actions/checkout in GHA workflows to v6 #117

ci: update actions/checkout in GHA workflows to v6

ci: update actions/checkout in GHA workflows to v6 #117

Workflow file for this run

name: Alpine on ARM 64
on: push
jobs:
alpine:
runs-on: ubuntu-24.04-arm
container:
image: 'alpine:3.22'
# Needed for Monkey-patch step.
volumes:
- /:/host
steps:
- name: Install and prepare Git
run: |
apk update && apk upgrade
apk add git
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Monkey-patch Alpine Node.js into runner
# This step is required because the actions refuse to run on ARM 64
# while in a container. So the OS ID is changed and the host's Node.js
# binary is replaced with the one from the container.
# Works for now, but may fail when Node or other stuff gets updated on
# the runner's side.
run: |
apk add nodejs
sed -i 's~ID=alpine~ID=nopine~g' /etc/os-release
cd /host/home/runner/actions-runner/*/externals/
rm -rf node20/*
mkdir node20/bin
ln -s /usr/bin/node node20/bin/node
# Fake Node.js 24 for actions/checkout@v6.
# Currently, Alpine 3.22 has Node.js 22.16.0, but that seems to work,
# too, because it looks like checkout is not using any stuff specific
# to Node.js 24.
rm -rf node24/*
mkdir node24/bin
ln -s /usr/bin/node node24/bin/node
# Checks-out the repository under $GITHUB_WORKSPACE.
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: 'recursive'
persist-credentials: false
- name: Install packages
run: |
apk update
apk add boost-dev catch2 cmake g++ libxml2-dev make pkgconf zlib-dev
apk add firefox-esr
- name: Build
run: |
cd "$GITHUB_WORKSPACE"
mkdir build
cd build
cmake ../
cmake --build . -j4
- name: Run tests
run: |
cd "$GITHUB_WORKSPACE/build"
ctest -V
- name: Install statically linked libraries
run: |
apk add libxml2-static xz-static zlib-static
- name: Build statically linked executables
run: |
cd "$GITHUB_WORKSPACE"
mkdir build-static
cd build-static
cmake ../ -DENABLE_LTO=ON -DENABLE_STATIC_LINKING=ON
cmake --build . -j4
- name: Run tests for statically linked build
run: |
cd "$GITHUB_WORKSPACE/build-static"
ctest -V
- name: Gather build artifacts
run: |
cd "$GITHUB_WORKSPACE"
mkdir artifacts
# binary files
cp build-static/code/pmdb artifacts/
# license + third-party notices
cp LICENSE artifacts/
cp third-party.md artifacts/
# template files
cp code/templates/*.tpl artifacts/
# documentation
cp -R documentation artifacts/documentation
unlink artifacts/documentation/msys2-build.md
unlink artifacts/documentation/SUMMARY.md
unlink artifacts/documentation/book.toml
unlink artifacts/documentation/.gitignore
# determine version
VERSION=$(git describe --always)
echo Version is $VERSION.
mv artifacts pmdb-$VERSION
tar czf pmdb_${VERSION}_linux-arm64-generic.tar.gz pmdb-$VERSION
- name: Archive build artifacts
uses: actions/upload-artifact@v5
with:
name: pmdb_linux-arm64-generic
path: pmdb_*_linux-arm64-generic.tar.gz
if-no-files-found: error