fix: relocatable installation (#9) #19
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: | |
push: | |
branches: [ main ] | |
tags: [ '*' ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
stringspinner: | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux/archlinux:latest | |
steps: | |
- name: update container packages | |
run: pacman -Syu --noconfirm | |
- name: install dependencies | |
run: | | |
pkgs=( | |
fmt | |
gcc | |
gcc-fortran | |
git | |
meson | |
ninja | |
pkgconf | |
pythia8 | |
python | |
tree | |
) | |
pacman -S --noconfirm ${pkgs[*]} | |
echo "[+++++] PACKAGE VERSIONS:" | |
for pkg in ${pkgs[@]}; do | |
echo "$pkg: $(pacman -Qi $pkg | grep -E '^Version')" | |
done | |
- name: git checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: meson setup | |
run: meson setup build --prefix=$(pwd)/install | |
- run: meson install | |
working-directory: build | |
- run: tree install | |
- run: meson test | |
working-directory: build | |
- name: test installation | |
run: install/bin/stringspinner --num-events 1 | |
- name: test relocatability | |
run: | | |
mkdir relocated | |
cp -r install relocated/ | |
relocated/install/bin/stringspinner --num-events 1 | |
- name: test symlinking | |
run: | | |
ln -sv install/bin/stringspinner | |
./stringspinner --num-events 1 |