-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): significantly speed up CI. (#1124)
- Loading branch information
Showing
26 changed files
with
319 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
target | ||
fendermint/builtin-actors | ||
contracts/cache | ||
contracts/node-modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: Build IPC | ||
|
||
# This workflow is triggered from the main CI workflow. | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Build IPC | ||
runs-on: ubuntu-latest | ||
env: | ||
RUST_BACKTRACE: full | ||
RUSTFLAGS: -Dwarnings | ||
|
||
steps: | ||
# https://github.com/marketplace/actions/free-disk-space-ubuntu | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
large-packages: false | ||
swap-storage: false | ||
docker-images: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
|
||
- 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: stable | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.19.0 | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
if: always() | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Cache Solidity ABI artifacts | ||
uses: actions/cache@v4 | ||
if: always() | ||
with: | ||
path: | | ||
./contracts/out | ||
./contracts/bindings | ||
./contracts/cache | ||
## TODO maybe add the rust version and solc version to the key | ||
key: v2-contracts-abi-${{ hashFiles('./contracts/**/*.sol') }} | ||
|
||
- name: Generate ABI and bindings | ||
run: cd contracts && make gen | ||
|
||
- name: Install Rust nightly | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: rustfmt,clippy | ||
|
||
- name: Check fmt (fmt, clippy) | ||
run: cargo +nightly fmt --check --all | ||
|
||
- name: Check clippy | ||
run: cargo clippy --tests --no-deps -- -D clippy::all | ||
|
||
- name: Build all | ||
run: | | ||
cd fendermint && make $PWD/builtin-actors/output/bundle.car | ||
cargo build --locked --release | ||
- name: Build Docker image for e2e tests | ||
run: | | ||
## Create the temporary Dockerfile. | ||
cat <<EOF > /tmp/Dockerfile | ||
# syntax=docker/dockerfile:1 | ||
FROM alpine as builder | ||
COPY /fendermint/app/config /app/fendermint/app/config | ||
COPY /target/release/fendermint /app/output/bin/fendermint | ||
COPY /target/release/ipc-cli /app/output/bin/ipc-cli | ||
EOF | ||
## Append the runner build phase to the Dockerfile. | ||
cat fendermint/docker/runner.Dockerfile >> /tmp/Dockerfile | ||
## Print the Dockerfile for debugging. | ||
echo "Dockerfile:" | ||
cat /tmp/Dockerfile | ||
## Create the temporary .dockerignore file. | ||
cat <<EOF > /tmp/Dockerfile.dockerignore | ||
target | ||
!target/release/fendermint | ||
!target/release/ipc-cli | ||
contracts/cache | ||
contracts/node-modules | ||
EOF | ||
## Print the .dockerignore file for debugging. | ||
echo "Dockerfile.dockerignore:" | ||
cat /tmp/Dockerfile.dockerignore | ||
## Build the Docker image. | ||
DOCKER_BUILDKIT=1 docker build \ | ||
--load \ | ||
-f /tmp/Dockerfile \ | ||
-t fendermint:latest \ | ||
. | ||
- name: Create artifacts directory | ||
run: mkdir -p /tmp/artifacts | ||
|
||
- name: Export Docker image | ||
run: docker save fendermint:latest > /tmp/artifacts/docker-image.tar | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: docker-image | ||
path: /tmp/artifacts/docker-image.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: NPM Audit | ||
name: 'Contracts: pnpm audit' | ||
|
||
# This workflow is triggered from the main CI workflow. | ||
on: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.