Skip to content

Commit 5f644ab

Browse files
committed
add gcp runner
1 parent 250fb1b commit 5f644ab

File tree

7 files changed

+1026
-892
lines changed

7 files changed

+1026
-892
lines changed

.github/workflows/build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: build-on-self-hosted-runner
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- "**.md"
9+
pull_request:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- "**.md"
14+
env:
15+
CARGO_TERM_COLOR: always
16+
GCP_ZONE: europe-west3-a
17+
18+
jobs:
19+
create-runner:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
label: ${{ steps.create-runner.outputs.label }}
23+
steps:
24+
- id: create-runner
25+
uses: related-sciences/[email protected]
26+
with:
27+
token: ${{ secrets.GH_SA_TOKEN }}
28+
project_id: ${{ secrets.GCP_PROJECT_ID }}
29+
service_account_key: ${{ secrets.GCP_SA_KEY }}
30+
image_project: ubuntu-os-cloud
31+
image_family: ubuntu-2004-lts
32+
machine_type: e2-highcpu-32
33+
disk_size: 100
34+
machine_zone: ${{ env.GCP_ZONE }}
35+
ephemeral: true
36+
37+
test-features:
38+
needs: create-runner
39+
runs-on: ${{ needs.create-runner.outputs.label }}
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Set HOME
44+
run: echo "HOME=/home/ubuntu" >> ${GITHUB_ENV}
45+
46+
- name: Install minimal nightly Rust
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: nightly-2023-05-22
51+
target: wasm32-unknown-unknown
52+
override: true
53+
components: rustfmt, clippy
54+
55+
- name: Install Dependencies
56+
run: sudo apt install protobuf-compiler clang build-essential -y
57+
58+
- name: 🫠 rustfmt 🫠
59+
uses: actions-rs/cargo@v1
60+
with:
61+
command: fmt
62+
args: --check
63+
64+
- name: Run tests with benchmarks
65+
run: cargo test --features runtime-benchmarks
Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
name: rust
2-
on:
3-
workflow_dispatch:
4-
push:
5-
branches:
6-
- main
7-
paths-ignore:
8-
- "**.md"
9-
pull_request:
10-
branches:
11-
- main
12-
paths-ignore:
13-
- "**.md"
14-
15-
env:
16-
CARGO_TERM_COLOR: always
17-
18-
jobs:
19-
build-imbue-collator:
20-
runs-on: ubuntu-latest
21-
steps:
22-
- name: Checkout sources
23-
uses: actions/checkout@v4
24-
with:
25-
submodules: recursive
26-
27-
- name: Install minimal nightly Rust
28-
uses: actions-rs/toolchain@v1
29-
with:
30-
profile: minimal
31-
toolchain: nightly-2023-05-22
32-
target: wasm32-unknown-unknown
33-
override: true
34-
35-
- name: Update submodules
36-
run: git submodule update --recursive --remote
37-
38-
- name: Clean unused directories
39-
run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY"
40-
41-
- name: Install Protobuf
42-
run: sudo apt install protobuf-compiler
43-
44-
- name: Run tests with benchmarks
45-
run: cargo test --features runtime-benchmarks
46-
clippy:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v4
50-
- name: Install Protobuf
51-
run: sudo apt install protobuf-compiler
52-
- name: Install minimal nightly Rust
53-
uses: actions-rs/toolchain@v1
54-
with:
55-
profile: minimal
56-
toolchain: nightly-2023-05-22
57-
target: wasm32-unknown-unknown
58-
override: true
59-
- name: Install clippy
60-
run: rustup component add clippy
61-
- name: Ensure executable
62-
run: chmod +x ./ci/jobs/clippy.sh
63-
- name: Run clippy
64-
run: ./ci/jobs/clippy.sh
65-
rustfmt:
66-
runs-on: ubuntu-latest
67-
steps:
68-
- uses: actions/checkout@v4
69-
- name: Install rustfmt
70-
run: rustup component add rustfmt
71-
- name: Ensure executable
72-
run: chmod +x ./ci/jobs/rustfmt.sh
73-
- name: Run rustfmt
74-
run: ./ci/jobs/rustfmt.sh
1+
#name: rust
2+
#on:
3+
# workflow_dispatch:
4+
# push:
5+
# branches:
6+
# - main
7+
# paths-ignore:
8+
# - "**.md"
9+
# pull_request:
10+
# branches:
11+
# - main
12+
# paths-ignore:
13+
# - "**.md"
14+
#
15+
# env:
16+
# CARGO_TERM_COLOR: always
17+
#
18+
#jobs:
19+
# build-imbue-collator:
20+
# runs-on: ubuntu-latest
21+
# steps:
22+
# - name: Checkout sources
23+
# uses: actions/checkout@v4
24+
# with:
25+
# submodules: recursive
26+
#
27+
# - name: Install minimal nightly Rust
28+
# uses: actions-rs/toolchain@v1
29+
# with:
30+
# profile: minimal
31+
# toolchain: nightly-2023-05-22
32+
# target: wasm32-unknown-unknown
33+
# override: true
34+
#
35+
# - name: Update submodules
36+
# run: git submodule update --recursive --remote
37+
#
38+
# - name: Clean unused directories
39+
# run: sudo rm -rf /usr/share/dotnet;sudo rm -rf /opt/ghc;sudo rm -rf "/usr/local/share/boost";sudo rm -rf "$AGENT_TOOLSDIRECTORY"
40+
#
41+
# - name: Install Protobuf
42+
# run: sudo apt install protobuf-compiler
43+
#
44+
# - name: Run tests with benchmarks
45+
# run: cargo test --features runtime-benchmarks
46+
# clippy:
47+
# runs-on: ubuntu-latest
48+
# steps:
49+
# - uses: actions/checkout@v4
50+
# - name: Install Protobuf
51+
# run: sudo apt install protobuf-compiler
52+
# - name: Install minimal nightly Rust
53+
# uses: actions-rs/toolchain@v1
54+
# with:
55+
# profile: minimal
56+
# toolchain: nightly-2023-05-22
57+
# target: wasm32-unknown-unknown
58+
# override: true
59+
# - name: Install clippy
60+
# run: rustup component add clippy
61+
# - name: Ensure executable
62+
# run: chmod +x ./ci/jobs/clippy.sh
63+
# - name: Run clippy
64+
# run: ./ci/jobs/clippy.sh
65+
# rustfmt:
66+
# runs-on: ubuntu-latest
67+
# steps:
68+
# - uses: actions/checkout@v4
69+
# - name: Install rustfmt
70+
# run: rustup component add rustfmt
71+
# - name: Ensure executable
72+
# run: chmod +x ./ci/jobs/rustfmt.sh
73+
# - name: Run rustfmt
74+
# run: ./ci/jobs/rustfmt.sh

0 commit comments

Comments
 (0)