-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (89 loc) · 2.86 KB
/
ci.yml
File metadata and controls
108 lines (89 loc) · 2.86 KB
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
name: CI/CD
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '1 0 * * 0'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Test build
id: docker_build_test
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
tags: matthewfeickert/pythia-python:test
load: true
push: false
- name: Image digest
run: echo ${{ steps.docker_build_test.outputs.digest }}
- name: List built images
run: docker images
- name: List Built Images
run: docker images
- name: Display user id
run: id
- name: Run test program in C++
run: >-
docker run --rm
--user $(id --user $USER):$(id --group)
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
'g++ tests/main01.cc -pthread -o tests/main01 $(pythia8-config --cxxflags --ldflags); ./tests/main01 > main01_out_cpp.txt';
wc main01_out_cpp.txt
- name: Run test program in Python
run: >-
docker run --rm
--user $(id --user $USER):$(id --group)
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
"python tests/main01.py > main01_out_py.txt";
wc main01_out_py.txt
- name: Test HepMC3
run: >-
docker run --rm
--user $(id --user $USER):$(id --group)
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
'g++ tests/main300.cc -pthread -o tests/main300 $(pythia8-config --cxxflags --ldflags) -lHepMC3; ./tests/main300 --input main300.cmnd --hepmc_output main300.hepmc'
wc main300.hepmc
- name: Test LHAPDF CLI
run: >-
docker run --rm
matthewfeickert/pythia-python:test
"lhapdf install CT10nlo"
- name: Test FastJet
run: >-
docker run --rm
--user $(id --user $USER):$(id --group)
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
'g++ tests/test_FastJet.cc -o tests/test_FastJet $(fastjet-config --cxxflags --libs --plugins); ./tests/test_FastJet'
- name: Test FastJet Python
run: >-
docker run --rm
--user $(id --user $USER):$(id --group)
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
"python tests/test_FastJet.py"
- name: Test Python imports
run: >-
docker run --rm
--volume $PWD:/home/docker/work
matthewfeickert/pythia-python:test
"python -m pip install --upgrade pytest; pytest --verbose tests"