-
Notifications
You must be signed in to change notification settings - Fork 9
123 lines (117 loc) · 3.82 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build Ngrok Java
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
- uses: ./.github/workflows/rust-cache
- uses: actions/setup-java@v3
with:
java-version: |
17
11
distribution: 'temurin'
cache: 'maven'
- name: Verification
run: mvn --batch-mode verify
env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
# We need to target older glibc (as old as possible) to support customers on very old Linux versions.
# If we end up needing to target older than 2.8, we will have to do a special workaround, as actions/checkout
# won't work without newer glibc versions:
# https://github.com/actions/checkout/issues/1809
build-glibc-2_28:
name: Build Ngrok Java (glibc 2.28)
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux_2_28_x86_64
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu
- uses: ./.github/workflows/rust-cache
- uses: actions/setup-java@v3
with:
java-version: |
17
11
distribution: 'temurin'
cache: 'maven'
- name: Install maven
run: |
curl -sL https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz -o maven.tar.gz
echo "332088670d14fa9ff346e6858ca0acca304666596fec86eea89253bd496d3c90deae2be5091be199f48e09d46cec817c6419d5161fb4ee37871503f472765d00 maven.tar.gz" | sha512sum -c -
tar xvf maven.tar.gz
rm maven.tar.gz
echo "JAVA_11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "JAVA_17_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
echo "./apache-maven-3.8.8/bin/" >> $GITHUB_PATH
- name: Verification
run: mvn --global-toolchains toolchains.xml --batch-mode verify
env:
NGROK_AUTHTOKEN: ${{ secrets.NGROK_AUTHTOKEN }}
udeps:
name: Udeps
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: jrobsonchase/[email protected]
- uses: ./.github/workflows/rust-cache
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: generate rust files
run: mvn --batch-mode --projects ngrok-java-native --also-make process-classes
- uses: actions-rs/cargo@v1
with:
command: udeps
args: '--workspace --all-targets --all-features --manifest-path ngrok-java-native/Cargo.toml'
fmt:
name: Rustfmt
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: jrobsonchase/[email protected]
- uses: actions-rs/cargo@v1
with:
command: fmt
args: '--all --manifest-path ngrok-java-native/Cargo.toml -- --check'
clippy:
name: Clippy
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: jrobsonchase/[email protected]
- uses: ./.github/workflows/rust-cache
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: generate rust files
run: mvn --batch-mode --projects ngrok-java-native --also-make process-classes
- uses: actions-rs/cargo@v1
with:
command: clippy
args: '--all-targets --all-features --workspace --manifest-path ngrok-java-native/Cargo.toml -- -D warnings'