-
Notifications
You must be signed in to change notification settings - Fork 276
133 lines (125 loc) · 4.45 KB
/
iroha2-release-pr.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
124
125
126
127
128
129
130
131
132
133
name: I2::Release::Tests
on:
pull_request:
branches: [stable, iroha2-lts]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
cli:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build iroha
working-directory: cli
run: mold --run cargo build
- name: Build iroha_client_cli
working-directory: client_cli
run: mold --run cargo build
- name: Build kagami
working-directory: tools/kagami
run: mold --run cargo build
- name: Mark binaries as executable
run: |
chmod +x target/debug/iroha
chmod +x target/debug/iroha_client_cli
chmod +x target/debug/kagami
- name: Setup test environment
run: python3 './scripts/test_env.py setup'
- name: Genesis test
run: bash -c './scripts/tests/genesis.sh || (cat test/peers/iroha0/.log; false )'
- name: Basic register and mint
if: always()
run: bash -c './scripts/tests/register_mint_quantity.sh || (cat test/peers/iroha0/.log; false )'
- name: Cleanup test environment
run: python3 './scripts/test_env.py cleanup'
- name: Panic on invalid genesis test
run: bash -c './scripts/tests/panic_on_invalid_genesis.sh'
bench:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run benchmarks
run: mold --run cargo bench --workspace --quiet
# ------------------------------ SDK tests go here ------------------------
java-api:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '11'
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build iroha
working-directory: cli
run: mold --run cargo build
- name: Build iroha_client_cli
working-directory: client_cli
run: mold --run cargo build
- name: Build kagami
working-directory: tools/kagami
run: mold --run cargo build
- name: Mark binaries as executable
run: |
chmod +x target/debug/iroha
chmod +x target/debug/iroha_client_cli
chmod +x target/debug/kagami
- name: Setup test environment
run: ./scripts/test_env.py setup
- name: Test iroha2-java API
run: ./scripts/API/java.sh setup && ./scripts/API/java.sh run
- name: Cleanup test iroha2-java API
run: ./scripts/API/java.sh cleanup
- name: Cleanup test environment
run: ./scripts/test_env.py cleanup
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't
# cached by GitHub Actions. Restoring these files from a
# GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
long:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- name: Run long tests
run: mold --run cargo test --workspace --no-fail-fast -- --ignored --test-threads=1 long