-
Notifications
You must be signed in to change notification settings - Fork 13
149 lines (147 loc) · 6.45 KB
/
github-actions-verify.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Verify
run-name: ${{ github.actor }} is running verification
on:
push:
workflow_dispatch:
jobs:
DeleteRelease:
permissions: write-all
runs-on: ubuntu-latest
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "Deleting release tag verify-${{ github.ref_name }}"
- run: |
gh release delete verify-${{ github.ref_name }} -y --cleanup-tag
CreateRelease:
permissions: write-all
runs-on: ubuntu-latest
continue-on-error: true
needs: DeleteRelease
env:
GH_TOKEN: ${{ github.token }}
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "Creating release tag verify-${{ github.ref_name }}"
- run: |
gh release create -n "verify ${{ github.ref_name }} branch" verify-${{ github.ref_name }}
Verification:
permissions: write-all
runs-on: ubuntu-latest
needs: CreateRelease
env:
QT_QPA_PLATFORM: offscreen
PATH: "/home/runner/FDS/FDS6/smvbin:/home/runner/FDS/FDS6/bin/INTEL/bin:/home/runner/FDS/FDS6/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/binner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/runner/.dotnet/tools"
FI_PROVIDER_PATH: "/home/runner/FDS/FDS6/bin/INTEL/prov"
LD_LIBRARY_PATH: "/home/runner/FDS/FDS6/bin/INTEL/lib:/usr/lib64:"
display_port: 1001
DISPLAY: ":1001"
PAUSE: 5
GH_TOKEN: ${{ github.token }}
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- run: sudo mkdir -m755 -p /etc/apt/keyrings
- run: sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
- name: Make file
run: |
echo "Types: deb deb-src" > tmp.txt
echo "URIs: https://qgis.org/ubuntu-ltr" >> tmp.txt
echo "Suites: jammy" >> tmp.txt
echo "Architectures: amd64" >> tmp.txt
echo "Components: main" >> tmp.txt
echo "Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg" >> tmp.txt
- run: sudo mv tmp.txt /etc/apt/sources.list.d/qgis.sources
- name: Update apt
run: sudo apt update
- name: Install qgis qgis-plugin-grass
run: sudo apt install qgis qgis-plugin-grass
- name: Check out repository code
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "The workflow is now ready to test your code on the runner."
- name: Configure plugin in qgis
run: sudo ln -s /home/runner/work/qgis2fds/qgis2fds /usr/share/qgis/python/plugins/qgis2fds
- name: Enable plugin in qgis
run: qgis_process plugins enable qgis2fds
#- name: Install FDS
# run: |
# wget https://github.com/firemodels/fds/releases/download/FDS-6.8.0/FDS-6.8.0_SMV-6.8.0_lnx.sh
# printf '1\n1\nyes\n' | bash FDS-6.8.0_SMV-6.8.0_lnx.sh
- name: Install FDS Nightly Build
run: |
cd /home/runner/
git clone https://github.com/firemodels/test_bundles
cd test_bundles
gh release download FDS_TEST --pattern '*_lnx.sh' -O "FDS-SMV-NIGHTLY.sh"
printf '1\n1\nyes\n' | bash FDS-SMV-NIGHTLY.sh
- name: Configure XServer
run: |
Xvfb :$display_port -fp /usr/share/X11/fonts/misc -screen 0 1280x1024x24 &
echo "setting up graphics environment (pausing $PAUSE s)"
- name: Download baseline results
run: |
cd /home/runner/work/qgis2fds
git clone https://github.com/firetools/qgis2fds.figures.git
#- name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Run Verification
run: |
cd verification
source /home/runner/FDS/FDS6/bin/FDS6VARS.sh
bash run.sh
#- name: Calculating image differences
# run: |
# cd verification
# mkdir -p tests/test_out
# mkdir -p tests/test_diff
# mkdir -p tests/test_err
# cp tests/*/output/*.png tests/test_out/
# bash compare_images.sh
#- name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Push results to release
run: |
cd verification/tests
find . -name "*.png" -o -name "*.fds" -o -name "*.bingeom" -o -name "*.ini" -o -name "*.ssf" -o -name "*.smv" > tarnames.txt
tar -cvf ../ubuntu.tar.gz -T tarnames.txt
gh release upload verify-${{ github.ref_name }} ../ubuntu.tar.gz --clobber
# gh release delete verify-${{ github.ref_name }} -y --cleanup-tag
# gh release create -n "verify ${{ github.ref_name }} branch" verify-${{ github.ref_name }} ubuntu.tar.gz
# gh release create ${{ github.ref }}-${{ runner.os }} data_out.tar.gz
- name: Check for errors
run: |
cd verification/logs
cat log.txt
if grep "err" log.txt; then
echo "Errors present in log file"
exit 1
fi
if grep "Err" log.txt; then
echo "Errors present in log file"
exit 1
fi
#- name: List files in the repository
# shell: bash
# run: |
# ls ${{ github.workspace }}/verification/tests/*/output/
# NUMBER_OF_ERR_FILES=$(ls verification/tests/test_err/ -1 | wc -l)
# echo "NUMBER_OF_ERR_FILES=$NUMBER_OF_ERR_FILES" >> "$GITHUB_ENV"
#- name: Setup upterm session
# uses: lhotari/action-upterm@v1
#- name: Check coverage tolerance
# if: ${{ env.NUMBER_OF_ERR_FILES > 0.0 }}
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('Rendered images out of tolerance')
- run: echo "This job's status is ${{ job.status }}."