forked from pzstorm/storm
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (103 loc) · 3.4 KB
/
Copy pathjava-ci.yaml
File metadata and controls
105 lines (103 loc) · 3.4 KB
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
on:
workflow_dispatch:
push:
paths:
- '**.java'
pull_request:
paths:
- '**.java'
# Continuous integration
name: build
jobs:
build:
name: Build and test on Linux
runs-on: ubuntu-latest
env:
PZ_VERSION: "41.76"
VERSIONSUFFIX: ${{ secrets.VERSIONSUFFIX }}
steps:
# Checkout repository
- uses: actions/checkout@v3
# Setup Java environment
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
# Configure GPG key
# as described https://github.com/crazy-max/ghaction-import-gpg
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# Cache gradle temporary files
- name: Cache gradle files
uses: actions/cache@v2
with:
path: ./.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Cache Project Zomboid classes
- name: Read Zomboid classes cache
id: pz-cache
uses: actions/cache@v2
with:
path: ./lib/
key: PZ-${{ env.PZ_VERSION }}-${{ secrets.CACHE_VERSION }}
# Install Project Zomboid classes
- name: Install Zomboid classes
if: steps.pz-cache.outputs.cache-hit != 'true'
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "mlem/zomboid"
version: "tags/v${{ env.PZ_VERSION }}"
file: "zomboid-${{ env.PZ_VERSION }}.jar"
target: "lib/zomboid-${{ env.PZ_VERSION }}.jar"
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Cache Project Zomboid classes
- name: Cache Zomboid classes
if: steps.pz-cache.outputs.cache-hit != 'true'
uses: actions/cache@v2
with:
path: ./lib/
key: PZ-${{ env.PZ_VERSION }}-${{ secrets.CACHE_VERSION }}
# Apply correct permissions for lib directory
- name: Apply directory permissions
run: sudo chmod a+rwx ./lib
# Assemble main classes with gradle
- name: Assemble classes
uses: burrunan/gradle-cache-action@v1
with:
arguments: classes -s
# Generate versionFile.txt
- name: Assemble classes
uses: burrunan/gradle-cache-action@v1
with:
arguments: currentVersion -PversionSuffix=${{ env.VERSIONSUFFIX }}
# Assemble distribution
- name: Assemble distributions
uses: burrunan/gradle-cache-action@v1
with:
arguments: distZip distTar -s -PversionSuffix=${{ env.VERSIONSUFFIX }}
# Run unit tests with gradle
- name: Run Unit Tests
uses: burrunan/gradle-cache-action@v1
with:
arguments: test -s
# Upload test reports as run artifact
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v2
with:
name: test-report-${{ runner.os }}
path: ./**/build/reports/tests/
# Upload dist artifacts as run artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Package
path: |
build/distributions/*.tar
build/distributions/*.zip