-
Notifications
You must be signed in to change notification settings - Fork 276
149 lines (141 loc) · 5.01 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: I2::Release::Tests
on:
pull_request:
branches: [ iroha2-stable, iroha2-lts ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
ALLURE_RESULTS: "${{ github.workspace }}/allure-results"
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }}
jobs:
client-cli-tests:
runs-on: [self-hosted, Linux, iroha2ci]
container:
image: hyperledger/iroha2-ci:nightly-2024-01-12
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install and configure allurectl
uses: allure-framework/setup-allurectl@v1
with:
allure-endpoint: https://soramitsu.testops.cloud
allure-token: ${{ secrets.ALLURE_TOKEN }}
allure-project-id: 1
- name: Build binaries
run: |
cargo build --bin iroha_client_cli
cargo build --bin kagami
cargo build --bin iroha
- name: Setup test Iroha 2 environment on bare metal
run: |
# TODO
# pip3 install -r scripts/requirements.txt --no-input
./scripts/test_env.py setup
- name: Mark binaries as executable
run: |
chmod +x ${{ env.CLIENT_CLI_DIR }}
- name: Install dependencies using Poetry
working-directory: client_cli/pytests
run: |
poetry install
- name: Run client cli tests and upload results to Allure Test Ops
working-directory: client_cli/pytests
run: |
allurectl watch -- poetry run pytest --alluredir=${ALLURE_RESULTS}
printenv | grep GITHUB_TESTS_
env:
GITHUB_TESTS_REF_NAME: ${{ github.ref_name }}
- name: Cleanup test environment
run: |
./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-2024-01-12
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-2024-01-12
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.sh 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.sh 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-2024-01-12
steps:
- name: Maximize build space
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- uses: actions/checkout@v4
- name: Run long tests
run: mold --run cargo test --workspace --no-fail-fast -- --ignored --test-threads=1 long