-
Notifications
You must be signed in to change notification settings - Fork 3
128 lines (114 loc) · 5.08 KB
/
bootstrap.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
119
120
121
122
123
124
125
126
127
128
name: Bootstrap and test new nain4 client project
on:
pull_request:
push:
paths-ignore:
- README.md
- .gitignore
- doc
- docs
jobs:
build-and-test-bootstrap-project:
# See https://wildwolf.name/github-actions-how-to-avoid-running-the-same-workflow-multiple-times/
if: (! contains(github.event.head_commit.message, '[skip ci]') &&
((github.event_name != 'pull_request') ||
(github.event.pull_request.head.repo.full_name !=
github.event.pull_request.base.repo.full_name))
)
runs-on: ${{ matrix.os }}
#continue-on-error: ${{ matrix.allow-fail }}
#continue-on-error: ${{ matrix.devshell == 'gcc' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-12 ]
py: [311]
devshell: [ clang, gcc ]
#allow-fail: [false]
exclude:
- os: macos-12
devshell: gcc
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
extra_nix_config: |
experimental-features = nix-command flakes
- uses: cachix/cachix-action@v12
with:
name: nain4 # The name of the Cachix cache
# If you chose signing key for write access
#signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
# If you chose API tokens for write access OR if you have a private cache
authToken: '${{ secrets.CACHIX_JACG_NAIN4 }}'
- name: Test bootstrapping of client project
run: |
cd ~/work
git config --global user.name Tester
git config --global user.email [email protected]
nix run github:jacg/nain4#bootstrap-client-project my-project name-chosen-by-me "description of my project"
cd my-project
nix develop -c just | tee just-output
PATTERN="end of event 10"
echo Looking for "'$PATTERN'" in output of 'just'
grep "$PATTERN" just-output
- name: Test nix run client app
run: |
nix run ~/work/my-project# -- -n 13 --early "/my/bubble_radius 0.2 m" | tee run-client-app-output
PATTERN="end of event 13"
echo Looking for "'$PATTERN'" in output of 'just'
grep "$PATTERN" run-client-app-output
- name: Test run dev environment
run: |
cd ~/work/my-project
nix develop .# -c just run --beam-on 12 | tee build-and-run-in-devenv-output
PATTERN="end of event 12"
echo Looking for "'$PATTERN'" in output of 'just'
grep "$PATTERN" build-and-run-in-devenv-output
- name: Run project tests in dev environment
run: |
cd ~/work/my-project
nix develop .# -c just test -v
- name: Test nix build client package
run: |
nix build ~/work/my-project#
- name: Test run nix build client package result
run: |
nix develop ~/work/my-project# -c result/bin/name-chosen-by-me --macro-path result/macs/ --beam-on 12 | tee build-and-run-client-package-output
PATTERN="end of event 12"
echo Looking for "'$PATTERN'" in output of 'just'
grep "$PATTERN" build-and-run-client-package-output
- name: Test variables set by nain4 setupHook
run: |
nix develop ~/work/my-project# -c env > my-project-env
echo ====== grepping for G4_DIR ====================
grep G4_DIR my-project-env
echo ===============================================
echo ====== grepping for G4_EXAMPLES ===============
grep G4_EXAMPLES my-project-env
echo ===============================================
echo grepping for QT_QPA_PLATFORM_PLUGIN_PATH
grep QT_QPA_PLATFORM_PLUGIN_PATH my-project-env
echo ===============================================
- name: Test variables set by bootstrap project
run: |
nix develop ~/work/my-project# -c env > my-project-env
var="name_chosen_by_me_lib_PATH"
echo ====== checking that $var exits =========================
grep "name_chosen_by_me" my-project-env
echo =========================================================
echo ====== grepping LD_LIBRARY_PATH for $libpath ============
grep "LD_LIBRARY_PATH=" my-project-env | grep "name-chosen-by-me"
echo =========================================================
echo ====== grepping PKG_CONFIG_PATH for $libpath ============
grep "PKG_CONFIG_PATH=" my-project-env | grep "name-chosen-by-me"
echo =========================================================
- name: Check that mdbook ANCHORs have been stripped from bootstrapped project
run: |
nix profile install nixpkgs#ripgrep
echo LOOKING FOR ANY REMAINING ANCHORS
rg ANCHOR ~/work/my-project | tee remaining-anchors
! test -s remaining-anchors