-
Notifications
You must be signed in to change notification settings - Fork 341
61 lines (47 loc) · 1.38 KB
/
test-publish.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
name: Continuous Integration
on:
push:
pull_request:
branches:
- master
jobs:
test:
name: Tests - Java version ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '14', '17', '21' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}
cache: 'gradle'
- run: make dependencies
- run: make all
- run: make test
publish:
needs: test
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'emichael/dslabs' }}
name: Publish handout
runs-on: ubuntu-latest
concurrency: publish-handout
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'
- run: make build/handout/
- run: |
cd build/handout/
git init -b handout
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Committing built handout"
git push -f "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" handout:handout
rm -rf .git
cd ../..