-
Notifications
You must be signed in to change notification settings - Fork 76
117 lines (102 loc) · 3.52 KB
/
test_release.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
# DO NOT MERGE THIS INTO main BRANCH
name: release-test
on:
push:
branches:
- nmv/add-musl-target-to-artifacts
env:
REPO_NAME: ${{ github.repository_owner }}/era-test-node
CARGO_TERM_COLOR: always
jobs:
build:
name: build release
strategy:
matrix:
arch: [x86_64-unknown-linux-musl]
include:
- arch: x86_64-unknown-linux-musl
platform: ubuntu-latest
runs-on: ${{ matrix.platform }}
container: clux/muslrust:stable
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install Rust toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Get latest version of stable Rust
run: rustup update stable
- name: Install target
run: rustup target add ${{ matrix.arch }}
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
# ==============================
# Builds
# ==============================
- name: Build era-test-node for ${{ matrix.arch }}
run: |
# cargo install cross
# export PATH="/github/home/.cargo/bin:$PATH"
# make build-${{ matrix.arch }}
apt-get update && apt-get install -y libclang-dev libc6-dev
cargo build --bin era_test_node --target ${{ matrix.arch }} --release
ls -la target/${{ matrix.arch }}/release
- name: Rename and move binary
run: |
mkdir artifacts
mv target/${{ matrix.arch }}/release/era_test_node ./artifacts
- name: Create artifacts
run: |
cd artifacts
tar -czf era_test_node-${{ matrix.arch }}.tar.gz era_test_node*
mv *tar.gz* ..
# =======================================================================
# Upload artifacts
# This is required to share artifacts between different jobs
# =======================================================================
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: era_test_node-${{ matrix.arch }}.tar.gz
path: era_test_node-${{ matrix.arch }}.tar.gz
- name: Upload signature
uses: actions/upload-artifact@v3
with:
name: era_test_node-${{ matrix.arch }}.tar.gz.asc
path: era_test_node-${{ matrix.arch }}.tar.gz.asc
test-package:
name: validate test release
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
# ==============================
# Download artifacts
# ==============================
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: era_test_node-x86_64-unknown-linux-musl.tar.gz
- name: Start the era_test_node
id: start_node
run: |
echo "Extracting era_test_node binary"
tar -xzf era_test_node-x86_64-unknown-linux-musl.tar.gz
chmod +x era_test_node
echo "Starting node in background"
./era_test_node run 2>&1 | tee era_test_node_ouput.log &
echo "PID=$!" >> $GITHUB_ENV
- name: Launch tests
id: launch
run: |
echo "Run tests"
make test-e2e
- name: Stop the era_test_node and print output logs
id: stop_node
if: always()
run: |
cat era_test_node_ouput.log
kill $PID