-
Notifications
You must be signed in to change notification settings - Fork 29
97 lines (97 loc) · 3.01 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
name: CI
on:
push:
branches:
- master
paths:
- src/**
- pom.xml
- .github/workflows/ci.yml
pull_request:
branches:
- master
paths:
- src/**
- '!src/main/resources/completions/*'
- pom.xml
- .github/workflows/ci.yml
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
platform: x86_64-pc-linux
classifier: linux-x86_64
move: mv
copy: cp
separator: /
extension: ""
- os: macos-latest
platform: x86_64-apple-darwin
classifier: osx-x86_64
move: mv
copy: cp
separator: /
extension: ""
- os: windows-latest
platform: x86_64-pc-win32
classifier: windows-x86_64
move: move
copy: copy
separator: \
extension: .exe
steps:
- uses: actions/checkout@v1
- uses: ayltai/setup-graalvm@v1
with:
java-version: 8
graalvm-version: 21.0.0.2
native-image: true
- uses: ilammy/[email protected]
if: runner.os == 'Windows'
- uses: microsoft/setup-msbuild@v1
if: runner.os == 'Windows'
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: tweak-for-windows
if: runner.os == 'Windows'
run: |
xcopy /E /Y C:\hostedtoolcache\windows\GraalVM\java8-windows-amd64-21.0.0.2\x64\jre\lib C:\hostedtoolcache\windows\GraalVM\java8-windows-amd64-21.0.0.2\x64\lib
- name: native-image
run: |
mkdir dist
mvn package -DskipTests
${{ matrix.copy }} target${{ matrix.separator }}rsc*.jar dist${{ matrix.separator }}
mvn package -Dversion-generate-skip=true -Pnative -DskipTests
${{ matrix.move }} target${{ matrix.separator }}classes${{ matrix.separator }}rsc-${{ matrix.classifier }}${{ matrix.extension }} dist${{ matrix.separator }}rsc-${{ matrix.platform }}${{ matrix.extension }}
- name: chmod
if: runner.os != 'Windows'
run: |
chmod +x dist${{ matrix.separator }}rsc-${{ matrix.platform }}${{ matrix.extension }}
- name: e2e-test-native
env:
RSC_PATH: ..${{ matrix.separator }}dist${{ matrix.separator }}rsc-${{ matrix.platform }}${{ matrix.extension }}
RSC_OIDCUSERNAME: ${{ secrets.RSC_OIDCUSERNAME }}
RSC_OIDCPASSWORD: ${{ secrets.RSC_OIDCPASSWORD }}
run: |
git clone https://github.com/making/rsc-e2e
mvn test -f rsc-e2e
- name: e2e-test-uber-jar
if: runner.os == 'Linux'
env:
RSC_OIDCUSERNAME: ${{ secrets.RSC_OIDCUSERNAME }}
RSC_OIDCPASSWORD: ${{ secrets.RSC_OIDCPASSWORD }}
run: |
export RSC_PATH="java -jar ../$(ls ./dist/*.jar)"
mvn test -f rsc-e2e
- name: upload-dist
uses: actions/upload-artifact@v1
with:
name: dist
path: dist