-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (112 loc) · 3.46 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
python
tree
# additional dependencies for documentation generation
perl
# additional dependencies for pythia build
make
rsync
which
)
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
path: stringspinner_src
- name: build pythia
run: |
git clone https://gitlab.com/Pythia8/releases.git pythia_src
prefix=$(pwd)/pythia_install
cd pythia_src
./configure \
--prefix=$prefix \
--cxx=$(which g++) \
--cxx-common="-fPIC" \
--cxx-shared="-shared -ldl"
make -j4
make install
echo "[+] set pythia environment vars:"
echo PATH=$prefix/bin${PATH:+:${PATH}} | tee -a $GITHUB_ENV
echo LD_LIBRARY_PATH=$prefix/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} | tee -a $GITHUB_ENV
echo PYTHIA8DATA=$prefix/share/Pythia8/xmldoc | tee -a $GITHUB_ENV
- name: pythia version
run: |
echo "## Pythia Version:" >> $GITHUB_STEP_SUMMARY
pythia8-config --version | tee -a $GITHUB_STEP_SUMMARY
- name: meson setup
run: meson setup build stringspinner_src --prefix=$(pwd)/install
- run: meson install
working-directory: build
- run: tree install
- run: meson test
working-directory: build
- name: test installation
run: install/bin/clas-stringspinner --num-events 1
- name: test OSG options
run: install/bin/clas-stringspinner --trig 10 --docker --seed 1448577483 # see `clas12-mcgen` documentation
- name: test relocatability
run: |
mkdir relocated
cp -r install relocated/
relocated/install/bin/clas-stringspinner --num-events 1
- name: test symlinking
run: |
ln -sv install/bin/clas-stringspinner
./clas-stringspinner --num-events 1
- name: generate documentation
run: |
mkdir publish
stringspinner_src/.github/generate_usage_guide.sh install/bin/clas-stringspinner |& tee publish/index.html
- name: upload documentation
uses: actions/upload-pages-artifact@v3
with:
retention-days: 3
path: publish/
deploy_webpages:
if: ${{ github.ref_type == 'tag' }}
needs: stringspinner
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: deployment
id: deployment
uses: actions/deploy-pages@v4