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

refactor(ci): move to smaller github action units #1279

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:

- name: Build all (including tests, benches, examples)
run: |
# TODO make building the bundle.car a dependency
cd fendermint && make $PWD/builtin-actors/output/bundle.car
cargo build --locked --release --all-targets

Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,6 @@ on:


jobs:
commonmark:
uses: ./.github/workflows/commonmark-lint.yaml

license:
uses: ./.github/workflows/license.yaml

contracts-prettier:
uses: ./.github/workflows/contracts-prettier.yaml

contracts-deployment-test:
uses: ./.github/workflows/contracts-deployment-test.yaml
needs: [contracts-prettier]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contracts-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
cache: false

- name: Cache Solidity ABI artifacts
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
./contracts/out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
FOUNDRY_PROFILE: ci

jobs:
examples-axelar-token:
demo-axelar-token:
name: "Demos: Axelar token"
runs-on: ubuntu-latest
strategy:
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/lint-code-quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Code Quality

on:
push:
branches:
- main
# Pattern matched against refs/tags
tags:
# Push events to every git tag not containing /
# NOTE: '**' would match tags with / in them, e.g. "foo/bar",
# but we want to use the tag as a docker tag as well, so it's best avoided.
- '*'

pull_request:
branches:
- '**'
# To add ready_for_review as a trigger we need to list all the defaults.
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:
rust:
name: Check Rust Code Quality
runs-on: ubuntu-22.04
env:
RUST_BACKTRACE: full
RUSTFLAGS: -Dwarnings

steps:
- name: Check out the project
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Tools
uses: ./.github/actions/install-tools
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
rust: 1.81.0

- name: Install Extra Libs
run: sudo apt-get install -y build-essential clang cmake pkg-config libssl-dev protobuf-compiler git curl

- name: Install Rust nightly
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-07-05
components: rustfmt,clippy

- name: Print Rust toolchain default versions
run: |
echo "rustup show:"
rustup show
echo "rustc version:"
rustc --version
echo "cargo version:"
cargo -V
echo "glibc version"
ldd --version

- name: Check fmt (nightly)
run: cargo +nightly-2024-07-05 fmt --check --all

- name: Check clippy
run: |
cargo clippy --release --tests --no-deps -- -D clippy::all
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
- name: Lint all commonmark/markdown files
uses: DavidAnson/markdownlint-cli2-action@v19
with:
fix: true
globs: '(scripts|crates)/**/README.md;contracts/specs/**/*.md;specs/**/*.md;docs/**/*.md'
fix: false
globs: '**/README.md;contracts/specs/**/*.md;specs/**/*.md;docs/**/*.md'
separator: ';'
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the project
uses: actions/checkout@v3

# This is so `make license` doesn't say "bad revision origin/main"
- name: Fetch origin for diff
run: git fetch origin
uses: actions/checkout@v4

- name: Check license headers
run: make license
30 changes: 30 additions & 0 deletions .github/workflows/lints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Lint PR title"

on:
pull_request:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
license:
uses: ./.github/workflows/lint-license.yaml

contracts-prettier:
uses: ./.github/workflows/lint-contracts-prettier.yaml

conventional-commits:
uses: ./.github/workflows/lint-convention-commits.yaml

commonmark:
uses: ./.github/workflows/lint-commonmark.yaml

code-quality:
uses: ./.github/workflows/lint-code-quality.yaml


Loading