Skip to content

Commit

Permalink
Add analogous gh jobs for .circleci/then.yml jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
cooldracula committed Aug 8, 2024
1 parent cb2e2cf commit d2bd558
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/install-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: 'Install Dependencies'
description: 'Install the dependencies and rust components used across jobs'
runs:
using: "composite"
steps:
- name: Install dependencies
run: |
sudo sed -i "/#\$nrconf{restart} = 'i';/s/.*/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
sudo apt-get update
sudo apt install -y libssl-dev clang libclang-dev protobuf-compiler
shell: bash
- name: Add rust components
run: |
rustup target add wasm32-unknown-unknown
rustup component add rust-src
shell: bash
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
shell: bash
40 changes: 40 additions & 0 deletions .github/workflows/build-and-run-node-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: "Build and run node-test"
on:
push:
paths:
- "node/**"
- "crates/**"
- "pallets/*"
- "runtime/*"

jobs:
node-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Increase swap
run: |
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
sudo chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
grep Swap /proc/meminfo
- name: Install dependencies
uses: ./.github/actions/install-dependencies/
- name: Build entropy-protocol nodejs package
run: |
cd crates/protocol
make build-nodejs-testing
cd nodejs-test
yarn
cd ../../..
- name: Run cargo test
timeout-minutes: 45
run: |
pushd node
cargo build --all-targets --release -j $(nproc)
cargo test --all-targets --release
yarn --cwd ../crates/protocol/nodejs-test test
cargo test -p entropy-tss --release --features=test_helpers -F wasm_test test_wasm
17 changes: 17 additions & 0 deletions .github/workflows/check-chainspecs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "Check chainspecs"
on: ["push"]

jobs:
check-chainspecs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies/
- name: Check chainspecs
run: |
cargo run -p entropy -- build-spec --raw --chain dev > chainspec-dev-raw.json
cargo run -p entropy -- build-spec --raw --chain integration-tests > chainspec-integration-raw.json
cargo run -p entropy -- build-spec --raw --chain testnet > chainspec-testnet-raw.json
14 changes: 14 additions & 0 deletions .github/workflows/check-doc-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: "Check documentation build"
on: ["push"]

jobs:
check-doc-build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies/
- name: Build documentation
run: cargo doc --no-deps
27 changes: 27 additions & 0 deletions .github/workflows/lint-and-check-licenses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: "Lint and check licenses"
on: ["push"]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies/
- name: Format and lint
run: |
curl -LsSf https://github.com/tamasfe/taplo/releases/download/0.8.0/taplo-full-linux-x86_64.gz | gunzip -N -d - > ${CARGO_HOME:-~/.cargo}/bin/taplo && chmod +x ${CARGO_HOME:-~/.cargo}/bin/taplo
cargo fmt --check
taplo fmt --check
cargo clippy -- -D warnings
check-licenses:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check licenses with cargo deny
run: |
cargo install --locked cargo-deny
cargo deny --all-features check license
14 changes: 14 additions & 0 deletions .github/workflows/test-runtime-benchmarks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Test: check runtime benchmarks"
on: ["push"]

jobs:
test-runtime-benchmarks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/actions/install-dependencies/
- name: Check runtime-benchmarks
run: |
pushd node && cargo check --features=runtime-benchmarks

0 comments on commit d2bd558

Please sign in to comment.