forked from artynova/hexdummy
-
Notifications
You must be signed in to change notification settings - Fork 5
71 lines (62 loc) · 1.94 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
name: Run tests
on:
push:
branches: "*"
pull_request:
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
java-version: [17]
mappings: [mojmap, yarn]
include:
# artifacts forbid `:` in filenames because of NTFS
# so just upload from Windows since hexdoc already accounts for that
- os: windows-latest
java-version: 17
upload: true
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Install Nox
run: pip install nox
- name: Copy template
run: nox -s ctt
- uses: gradle/gradle-build-action@v2
with:
build-root-directory: .ctt/${{ matrix.mappings }}
- name: Run tests
run: nox -k ${{ matrix.mappings }}
# kill java because gradle leaves an orphaned process that interferes with git clean
- name: Prepare rendered project for upload
if: matrix.upload
run: |
mkdir _build
cp .ctt/${{ matrix.mappings }}/*/build/libs/*.jar _build
cd .ctt/${{ matrix.mappings }}
taskkill /F /IM "java.exe"
git config core.longPaths true
git clean -fdX --exclude "!_site/"
- name: Upload full rendered project artifact
if: matrix.upload
uses: actions/upload-artifact@v4
with:
name: example-${{ matrix.mappings }}-full
path: .ctt/${{ matrix.mappings }}/
- name: Upload build artifact
if: matrix.upload
uses: actions/upload-artifact@v4
with:
name: example-${{ matrix.mappings }}-build
path: _build/