-
Notifications
You must be signed in to change notification settings - Fork 393
90 lines (88 loc) · 3.08 KB
/
test.yaml
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
name: Check that generated data is up to date and update data for web manual
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle
.gradle
build
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Compile IE
run: ./gradlew compileJava
- name: Run unit tests
run: ./gradlew test
- name: Update APT cached
run: sudo apt update
- name: Install ffprobe
run: sudo apt install ffmpeg
- name: Check for stereo sound files
run: scripts/check_sounds.sh
datagen:
runs-on: ubuntu-latest
needs: test
defaults:
run:
working-directory: main-repo
steps:
- uses: actions/checkout@v3
with:
path: main-repo
- uses: actions/checkout@v3
with:
path: manual-data
- name: Set up manual data repo
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref_name, '1.')}}
run: |
cd ../manual-data
MANUAL_BRANCH=manual-data/$(git branch --show-current)
echo Online manual data branch: $MANUAL_BRANCH
git fetch
git switch $MANUAL_BRANCH || git switch --orphan $MANUAL_BRANCH
cd ../main-repo
- uses: actions/cache@v3
with:
path: |
~/.gradle
.gradle
build
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Create list of existing generated resources
run: find src/generated/resources/ ! -path "**/.cache*" > resources.txt
- name: Run data generation
run: xvfb-run --auto-servernum bash -c "ie_manual_datagen_path=$(pwd)/../manual-data ./gradlew runData"
- name: Check that no files have changed
run: git update-index --really-refresh || (git diff && false)
- name: Create list of actual generated resources
run: find src/generated/resources/ ! -path "**/.cache*" > resources_new.txt
- name: Check that no new resources have been created
run: diff resources.txt resources_new.txt
- name: Commit and push manual data
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref_name, '1.')}}
run: |
cd ../manual-data/
git add --all
if ! git diff-index --quiet HEAD ; then
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "Update generated manual data"
git push --set-upstream origin $(git branch --show-current)
fi