Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Build separation #188

Merged
merged 44 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
94e5c35
add coverage report for ci
Raid5594 Nov 28, 2023
2d197d2
add tarapulin using github actions
Raid5594 Nov 28, 2023
f162fbf
quick fix
Raid5594 Nov 28, 2023
b8c40e0
update runner machine
Raid5594 Nov 29, 2023
8c90604
change xlarge nodes to large
Raid5594 Dec 1, 2023
32fa117
fix error in check.yaml
Raid5594 Dec 4, 2023
3048e60
fix actions version in check.yaml
Raid5594 Dec 4, 2023
ff20ed7
add apt update
Raid5594 Dec 4, 2023
ca0a358
install rust
Raid5594 Dec 4, 2023
2d5f9c6
install rustup
Raid5594 Dec 4, 2023
aa81866
update rustup setup
Raid5594 Dec 4, 2023
3c3167f
update rustup setup
Raid5594 Dec 4, 2023
1f36c27
update rustup setup
Raid5594 Dec 4, 2023
b059348
update rustup setup
Raid5594 Dec 4, 2023
af40d0e
update rustup setup
Raid5594 Dec 4, 2023
60fec30
update rustup setup
Raid5594 Dec 4, 2023
3c30e5c
update rustup setup
Raid5594 Dec 4, 2023
68e0d63
update rustup setup
Raid5594 Dec 4, 2023
ec97bb6
update rustup setup
Raid5594 Dec 4, 2023
0b84850
Remove is_some_and
rakanalh Dec 5, 2023
db67955
Update tarpaulin version
rakanalh Dec 5, 2023
87ba793
Use nightly
rakanalh Dec 5, 2023
74acc59
Restore removed annotations and use rust-toolchain config in root
rakanalh Dec 5, 2023
2a34450
Fix tarpaulin version
rakanalh Dec 5, 2023
aacec75
install nightly
Raid5594 Dec 5, 2023
2c79001
Specific nightly build
rakanalh Dec 5, 2023
04cee95
Test installing toolchain through an action
rakanalh Dec 5, 2023
a21621c
Restore removed parts
rakanalh Dec 5, 2023
f08d02d
Separate jobs
rakanalh Dec 5, 2023
84abe91
Add runs-on
rakanalh Dec 5, 2023
17edc15
Change name of workflow
rakanalh Dec 5, 2023
8f50372
Add components
rakanalh Dec 5, 2023
c957e0d
Rename files and update names of workflows
rakanalh Dec 5, 2023
de1d3f0
Checkout code for clippy
rakanalh Dec 5, 2023
4e23e21
clippy needs protoc
rakanalh Dec 5, 2023
7157b30
Try a larger memory worker
rakanalh Dec 6, 2023
42d3012
Install openssl
rakanalh Dec 6, 2023
c7515a4
Make symlink
rakanalh Dec 6, 2023
89c23a4
Undo openssl stuff
rakanalh Dec 6, 2023
82fbf34
Fix multiplication overflow
rakanalh Dec 10, 2023
eccdd69
Update time_to_reach_zero test
rakanalh Dec 18, 2023
60b7db3
Merge remote-tracking branch 'origin/chore/cleanup-ddc-offchain' into…
rakanalh Dec 26, 2023
0130016
Cleanup multiplier tests
rakanalh Dec 26, 2023
50e23c6
Add gitguardian ignore rule
rakanalh Dec 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitguardian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Required, otherwise ggshield considers the file to use the deprecated v1 format
version: 2

secret:
# Exclude files and paths by globbing
ignored-paths:
- node/service/chain-specs/example.json
52 changes: 0 additions & 52 deletions .github/workflows/check.yaml

This file was deleted.

143 changes: 97 additions & 46 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,109 @@
name: CI
name: PR

# Controls when the action will run.
on:
pull_request:
branches:
- dev
- master
- 'feature/**'
- 'release/**'
- 'hotfix/**'
types:
- opened
- synchronize
- edited

env:
PROFILE: release
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ '**' ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
id-token: write
contents: read

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
concurrency: dev
format:
name: Check Lints
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Configure AWS credentials ORG
uses: aws-actions/configure-aws-credentials@v1
toolchain: nightly-2022-10-09
override: true
components: rustfmt
- name: Check TOML
uses: dprint/[email protected]
- name: Check Format
run: |
cargo fmt -- --check

check:
name: Cargo check
needs: format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
aws-access-key-id: ${{ secrets.ORG_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ORG_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
toolchain: nightly-2022-10-09
override: true
target: wasm32-unknown-unknown
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
- name: Check Build for Benchmarking
run: >
pushd node &&
cargo check --features=runtime-benchmarks --release

- name: Login to Amazon ECR ORG
id: login-ecr-org
uses: aws-actions/amazon-ecr-login@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
clippy:
name: Run Clippy
needs: format
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-10-09
override: true
target: wasm32-unknown-unknown
components: clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check with Clippy
run: |
cargo clippy --no-deps --all-targets --features runtime-benchmarks --workspace -- --deny warnings

- name: Build and push docker image to ECR Docker
uses: docker/build-push-action@v4
tests:
name: Run tests
needs: format
# The type of runner that the job will run on
runs-on: ["self-hosted", "cere-network-memory-large"]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install linux dependencies
run: sudo apt update && sudo apt install -y cargo clang libssl-dev llvm libudev-dev protobuf-compiler
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-10-09
override: true
target: wasm32-unknown-unknown
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
version: '0.22.0'
args: '--verbose --locked --no-fail-fast --workspace --features runtime-benchmarks --out "Xml"'
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
context: .
file: Dockerfile.tests
push: false
build-args: |
"ECR_REGISTRY=${{ steps.login-ecr-org.outputs.registry }}"
name: tarpaulin coverage
path: ./tarpaulin-report.xml
2 changes: 1 addition & 1 deletion .github/workflows/dev.yaml → .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release to dev
name: E2E
on:
push:
branches:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/ecr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ECR

on:
pull_request:
branches:
- dev
- master
- 'release/**'
- 'hotfix/**'
types:
- opened
- synchronize
- edited

env:
PROFILE: release

jobs:
build:
runs-on: ubuntu-latest
concurrency: dev
steps:
- uses: actions/checkout@v3

- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Configure AWS credentials ORG
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ORG_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.ORG_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Login to Amazon ECR ORG
id: login-ecr-org
uses: aws-actions/amazon-ecr-login@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push docker image to ECR Docker
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.tests
push: false
build-args: |
"ECR_REGISTRY=${{ steps.login-ecr-org.outputs.registry }}"
Loading
Loading