Skip to content

Commit 1fe85fc

Browse files
committed
[ci skip] refactor pos automation
1 parent 5a162b1 commit 1fe85fc

File tree

2 files changed

+92
-39
lines changed

2 files changed

+92
-39
lines changed

.github/workflows/automation.yml

+1-39
Original file line numberDiff line numberDiff line change
@@ -77,42 +77,4 @@ jobs:
7777
if: steps.check.outputs.triggered != 'true'
7878
run: echo "Comment \"$COMMENT\" not matched"
7979
env:
80-
COMMENT: ${{ matrix.make.comment }}
81-
82-
tasks: # tasks with commands with no external deps
83-
if: ${{ github.event.issue.pull_request }}
84-
runs-on: ${{ matrix.os }}
85-
timeout-minutes: ${{ matrix.make.timeout }}
86-
strategy:
87-
fail-fast: false
88-
matrix:
89-
os: [ubuntu-20.04]
90-
make:
91-
- name: Run PoS state-machine tests
92-
comment: pls run pos tests
93-
command: PROPTEST_CASES=300 make test-pos-sm # PoS state machine tests
94-
timeout: 600 # 10 hours
95-
96-
steps:
97-
- uses: khan/[email protected]
98-
id: check
99-
with:
100-
trigger: ${{ matrix.make.comment }}
101-
reaction: eyes
102-
env:
103-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104-
- uses: xt0rted/pull-request-comment-branch@v1
105-
if: steps.check.outputs.triggered == 'true'
106-
id: comment-branch
107-
- uses: actions/checkout@v3
108-
if: steps.check.outputs.triggered == 'true'
109-
with:
110-
ref: ${{ steps.comment-branch.outputs.head_ref }}
111-
- name: Install Protoc
112-
uses: arduino/setup-protoc@v1
113-
if: steps.check.outputs.triggered == 'true'
114-
with:
115-
repo-token: ${{ secrets.GITHUB_TOKEN }}
116-
- name: Run task ${{ matrix.make.name }}
117-
if: steps.check.outputs.triggered == 'true'
118-
run: ${{ matrix.make.command }}
80+
COMMENT: ${{ matrix.make.comment }}

.github/workflows/triggerable.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Triggerable Tasks
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: 'The branch name'
8+
required: true
9+
type: string
10+
total_tests:
11+
description: 'Total prop. test cases'
12+
required: false
13+
default: 150
14+
type: number
15+
16+
permissions:
17+
id-token: read
18+
contents: read
19+
pull-requests: write
20+
21+
env:
22+
GIT_LFS_SKIP_SMUDGE: 1
23+
CHAIN_BUCKET: anoma-iac-files-master
24+
25+
jobs:
26+
pos:
27+
runs-on: ${{ matrix.os }}
28+
timeout-minutes: ${{ matrix.make.timeout }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
os: [ubuntu-20.04]
33+
mold_version: [2.1.0]
34+
make:
35+
- name: Run PoS state-machine tests
36+
command: make test-pos-sm
37+
timeout: 360
38+
cache_key: namada
39+
cache_version: v2
40+
41+
env:
42+
CARGO_INCREMENTAL: 0
43+
RUST_BACKTRACE: full
44+
RUSTC_WRAPPER: sccache
45+
SCCACHE_CACHE_SIZE: 100G
46+
SCCACHE_BUCKET: namada-sccache-master
47+
48+
steps:
49+
- uses: actions/checkout@v3
50+
with:
51+
ref: ${{ inputs.branch }}
52+
- name: Configure AWS Credentials
53+
uses: aws-actions/configure-aws-credentials@v1
54+
with:
55+
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
56+
aws-region: eu-west-1
57+
- name: Install Protoc
58+
uses: arduino/setup-protoc@v1
59+
with:
60+
repo-token: ${{ secrets.GITHUB_TOKEN }}
61+
- name: Run sccache-cache
62+
uses: mozilla-actions/[email protected]
63+
- name: Setup rust toolchain
64+
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
65+
with:
66+
profile: default
67+
override: true
68+
- name: Cache cargo registry
69+
uses: actions/cache@v3
70+
continue-on-error: false
71+
with:
72+
path: |
73+
~/.cargo/registry
74+
~/.cargo/git
75+
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
76+
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
77+
- name: Start sccache server
78+
run: sccache --start-server
79+
- name: Install mold linker
80+
run: |
81+
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
82+
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
83+
- name: Run task `${{ matrix.make.name }}`
84+
run: ${{ matrix.make.command }}
85+
env:
86+
PROPTEST_CASES: ${{ inputs.total_tests }}
87+
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
88+
- name: Stats sccache server
89+
run: sccache --show-stats || true
90+
- name: Start sccache server
91+
run: sccache --stop-server || true

0 commit comments

Comments
 (0)