forked from EnigmaticaModpacks/Enigmatica6
-
Notifications
You must be signed in to change notification settings - Fork 1
168 lines (149 loc) · 4.66 KB
/
ci.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Continuous Integration
on:
push:
branches:
- 'develop'
- 'master'
- 'ci/*'
pull_request:
branches:
- 'develop'
- 'master'
- 'ci/*'
jobs:
# job
instancesync:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- uses: actions/cache@v3
with:
path: mods
key: ${{ github.run_id }}-instancesync
- run: java -jar InstanceSync.jar
#job
mods:
runs-on: ubuntu-latest
needs: [instancesync, compile]
steps:
- uses: actions/cache@v3
with:
path: mods
key: ${{ github.run_id }}-mods
restore-keys: |
${{ github.run_id }}-instancesync
- run: find . -name 'kubejs-forge-*' -delete
- uses: actions/download-artifact@v3
with:
name: compiled (kubejs)
path: mods
- run: ls
working-directory: mods
# job
server:
needs: [mods]
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
packmode: ['normal', 'expert']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- uses: actions/cache@v3
with:
path: mods
key: ${{ github.run_id }}-mods
- name: Setting mode to ${{ matrix.packmode }}
run: |
node .github/actions/ci/packmode.js ${{ matrix.packmode }} > mode.json
cat mode.json
- name: Install server
run: |
cp ./automation/settings.cfg ./settings.cfg
cp ./automation/start-automated-server.sh ./start-automated-server.sh
pwsh ./automation/remove-client-mods.ps1
- name: Setting eula to true
run: |
echo "eula=true" > eula.txt
cat eula.txt
- run: node .github/actions/ci/start-server.js bash ./start-automated-server.sh
- run: sleep 1m
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: server (${{ matrix.packmode }})
path: |
./logs
./crash-reports
./kubejs/exported
# job
kubejs:
needs: [server]
runs-on: ubuntu-latest
timeout-minutes: 2
strategy:
fail-fast: false
matrix:
packmode: ['normal', 'expert']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Run actions/setup-npm@v3
run: cd .github/actions/ci/node && npm install
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: server (${{ matrix.packmode }})
- run: tree
- run: node .github/actions/ci/log-kubejs-warnings.js
- run: node .github/actions/ci/kubejs-recipes.js
- run: node .github/actions/ci/kubejs-list-hose-pulley-fluids.js
- run: node .github/actions/ci/node/kubejs-list-global-variables.js
- name: Compare against the base branch
if: github.event_name == 'pull_request'
run: |
node .github/actions/ci/node/compare_download-artifact.js ${{ github.event.pull_request.base.repo.full_name }} ${{ github.event.pull_request.base.sha }} ${{ matrix.packmode }} ${{ github.token }}
node .github/actions/ci/node/compare_artifact-tags.js
#job
compile:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
repo: ['kubejs']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- run: git clone --branch 1605 https://github.com/KubeJS-Mods/KubeJS.git
- run: git apply ../.github/actions/ci/patches/kubejs.patch
working-directory: KubeJS
- uses: actions/cache@v3
id: cache
with:
path: ./KubeJS/forge/build/libs
key: compile-${{ matrix.repo }}-v2-${{ hashFiles('.github/actions/ci/patches/kubejs.patch') }}
- name: Gradle
if: steps.cache.outputs.cache-hit != 'true'
run: |
./gradlew -p forge build
tree
working-directory: KubeJS
- uses: actions/upload-artifact@v3
with:
name: compiled (${{ matrix.repo }})
path: ./KubeJS/forge/build/libs/kubejs-forge-1605.3.20-build.9999.jar