-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (110 loc) · 3.9 KB
/
Integration.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
name: Integration Tests
on: [pull_request]
jobs:
tests:
name: ${{ matrix.make.name }} (${{ matrix.os }})
runs-on: ubuntu-latest # Specifies the runner environment
container:
image: archlinux:latest # Specifies that an Arch Linux container should be used for executing the job's steps
strategy:
fail-fast: false
matrix:
os: [archlinux-latest] # This can be kept for naming consistency, but isn't functionally necessary
rust: [1.73.0]
make:
- name: Run integration tests # Integration tests
task: "(cd deployment && NODE_TYPE=LocalSecret ./gradlew jvmTest --build-cache --no-daemon)"
sccache-path: [/home/runner/.cache/sccache]
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
RUSTV: ${{ matrix.rust }}
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: ${{ matrix.sccache-path }}
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
# Service containers to run with `container-job`
services:
# Label used to access the service container
secret:
# Docker Hub image
image: ghcr.io/scrtlabs/localsecret:v1.12.0-beta.8
ports:
# Opens tcp port
- 5000:5000
- 9091:9091
- 1317:1317
steps:
- uses: actions/checkout@v3
- name: Install sccache
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.2.15
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
cache: 'gradle'
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Add wasm toolchain
run: |
rustup target add wasm32-unknown-unknown
- name: Install Netcat
run: pacman -Syu --noconfirm netcat
- name: Test connectivity to secret service
run: |
nc -zv secret 5000
- name: Install wasm-opt
run: |
pacman -Syu binaryen --noconfirm
- name: Install development tools
run: pacman -Syu base-devel --noconfirm
- name: Install Clang
run: pacman -Syu clang --noconfirm
- name: Install socat
run: pacman -Syu --noconfirm socat
- name: Set up port forwarding to secret service
run: |
socat TCP4-LISTEN:5000,reuseaddr,fork TCP4:secret:5000 &
socat TCP4-LISTEN:9091,reuseaddr,fork TCP4:secret:9091 &
socat TCP4-LISTEN:1317,reuseaddr,fork TCP4:secret:1317 &
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: ${{ matrix.sccache-path }}
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-
- name: Start sccache server
run: sccache --start-server
- name: Compile code
run: make build
- name: ${{ matrix.make.name }}
run: ${{ matrix.make.task }}
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true