-
Notifications
You must be signed in to change notification settings - Fork 2.1k
80 lines (80 loc) · 2.65 KB
/
buildtest.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
---
name: Run Tests
on:
pull_request:
branches:
- dev
workflow_dispatch: null
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run_build_diff:
runs-on: ubuntu-latest
steps:
- name: Checkout HEAD
uses: actions/checkout@v4
- name: Fetch Dev branch
run: git fetch --depth=1
- name: Get Dev branch HEAD hash
id: get-dev-ref
run: echo "devref=$(git rev-parse origin/dev)" >> $GITHUB_OUTPUT
- name: Create cache folder
run: mkdir /tmp/cache/
- name: Check if build cache exists
uses: actions/cache@v4
with:
path: /tmp/cache/
key: ${{ steps.get-dev-ref.outputs.devref }}
- name: Download latest build list
uses: dawidd6/action-download-artifact@3ecf4024886f219d9290351234889bfb45d1b9da
with:
name: builds.txt
if_no_artifact_found: warn
workflow: updatebuildlist.yml
- name: Update static builds list
if: steps.download-builds.outputs.found_artifact == true
run: cat builds.txt > spec/builds.txt
- name: Download latest build xmls
uses: dawidd6/action-download-artifact@3ecf4024886f219d9290351234889bfb45d1b9da
with:
name: build-xmls
if_no_artifact_found: warn
path: /tmp/cache/
- name: Make sure cache is readable by docker
run: chmod -R 777 /tmp/cache
- name: Run build diff
run: docker compose run -v '/tmp/cache/:/cache' -e 'CACHEDIR=/cache' busted-diff
| tee /tmp/dockerlog
- name: Generate artefact
run: |
sed -n '/Savefile Diff for/, $p' /tmp/dockerlog | tee /tmp/artefact
[ -s /tmp/artefact ] || rm /tmp/artefact
- name: Upload artefact
uses: actions/upload-artifact@v4
with:
name: build-diff-output
path: /tmp/artefact
- name: move xmls found in builds.txt to a new directory
run: |
mkdir new-build-xmls
while IFS= read -r line; do
FILENAME="/tmp/cache/$( echo $line | tr -cd '[[:alnum:]]').xml"
if [ -f "$FILENAME" ]; then
mv "$FILENAME" "./new-build-xmls/"
fi
done < "./spec/builds.txt"
- name: Upload new build xmls
uses: actions/upload-artifact@v4
with:
name: build-xmls
path: './new-build-xmls/*'
overwrite: true
retention-days: 3
- name: Upload cache
uses: actions/upload-artifact@v4
with:
name: build-cache
path: './tmp/cache/*'
overwrite: true
retention-days: 3