Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0b25d25
ci docker build
Aug 19, 2024
55039a9
fix ci
Aug 19, 2024
fd2cb3c
update tests
Aug 19, 2024
2c7bfc0
fix ci
Aug 19, 2024
08dfc38
fix abi
Aug 19, 2024
4e3ccf9
update CI
Aug 19, 2024
0d31c6b
fix rust version
Aug 19, 2024
5e52f39
update contract path
Aug 19, 2024
6009bd8
update working dir
Aug 19, 2024
e9a9522
fix abi
Aug 19, 2024
c968935
compile abi first
Aug 19, 2024
2d4b492
compile abi only
Aug 19, 2024
6997870
add docker support
Aug 19, 2024
1fba859
export docker
Aug 19, 2024
dd8e174
enable rust in contract test
Aug 19, 2024
a0fd434
trigger fvm test quick
Aug 19, 2024
4033d1c
enable fendermint e2e tests
Aug 19, 2024
563210e
enable cache
Aug 19, 2024
0cb5b43
compile abi
Aug 19, 2024
83c2f9b
fix binding
Aug 19, 2024
4e03ece
compile binding
Aug 19, 2024
c45be6e
fix clang
Aug 19, 2024
5fef732
remove make build
Aug 19, 2024
07b1844
test docker build cache
Aug 19, 2024
59d2405
docker build
Aug 19, 2024
c3660a7
update check out fendermint
Aug 19, 2024
118e05e
enable ci build
Aug 19, 2024
24574a9
build docker image only
Aug 19, 2024
707b05d
test docker build cache only
Aug 19, 2024
8a0ccb9
update docker build
Aug 20, 2024
1cbdafa
update docker build
Aug 20, 2024
d3eb0d8
update docker image
Aug 20, 2024
7f71578
copy git add -A
Aug 20, 2024
73fdc2d
update docker build
Aug 20, 2024
702774e
fix mv
Aug 20, 2024
214043c
fix path
Aug 20, 2024
506f904
remove unused stps
Aug 20, 2024
19272b8
debug fendermint e2e tests
Aug 20, 2024
1ba7d30
fix dockerfile
Aug 20, 2024
0b1c1c7
profile is ci
Aug 20, 2024
0f55d2e
build ipc actor binding
Aug 20, 2024
de3f22c
simplify the CI improvements + delete cruft.
raulk Aug 20, 2024
08068bb
make bundle file directly.
raulk Aug 20, 2024
5de656b
check fmt and clippy.
raulk Aug 20, 2024
f1ed0aa
nightly.
raulk Aug 20, 2024
4529213
toolchain.
raulk Aug 20, 2024
0a76346
fix tests workflows.
raulk Aug 20, 2024
61362f9
compile ABI.
raulk Aug 20, 2024
4a5841e
bump cache plugin version.
raulk Aug 20, 2024
79ed6d8
generate bindings too.
raulk Aug 21, 2024
9f9d1fe
fix paths.
raulk Aug 21, 2024
5d91bac
fix clippy.
raulk Aug 21, 2024
4d1a931
save cache even when build fails.
raulk Aug 21, 2024
f58d345
bindings build script: only rerun if abis change.
raulk Aug 21, 2024
ad9d8be
cache bindings too.
raulk Aug 21, 2024
f301324
fix docker build.
raulk Aug 21, 2024
e72a82d
fix docker build.
raulk Aug 21, 2024
0320df7
cache always; make artifacts dir.
raulk Aug 22, 2024
2cfecaa
disable contracts-pnpm-audit job.
raulk Aug 22, 2024
387e8cf
switch to Swatinem cache; fix directories.
raulk Aug 22, 2024
2f66184
fix contracts cache hash.
raulk Aug 22, 2024
afacf71
fix artifacts and cache hashes.
raulk Aug 22, 2024
c336738
splinter test make targets.
raulk Aug 22, 2024
cf8ccb2
use correct cache version.
raulk Aug 22, 2024
29f97f1
set the default log level to Info.
raulk Aug 22, 2024
8b3ff02
keep the compilation cache in the contracs-abi cache.
raulk Aug 22, 2024
28538e7
cleanup ci.
raulk Aug 22, 2024
3c21949
drop coverage check from contracts (flaky).
raulk Aug 22, 2024
9e1ba45
install all tools for tests.
raulk Aug 22, 2024
2d10fa8
actually cache the cache.
raulk Aug 22, 2024
bdf6f55
Merge branch 'simple-genesis' into genesis-pr-cleanup
raulk Aug 22, 2024
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: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
target
fendermint/builtin-actors
contracts/cache
contracts/node-modules
18 changes: 0 additions & 18 deletions .github/workflows/add-bug-tracker.yaml

This file was deleted.

141 changes: 141 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
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 Cargo Build
# uses: actions/cache@v4
# if: always()
# with:
# path: |
# /home/runner/.cargo/registry
# /home/runner/.cargo/git
# target
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# ## save-always doesn't work.
# ## See https://github.com/actions/cache/issues/1315.
# save-always: 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
106 changes: 26 additions & 80 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,53 +23,16 @@ on:


jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
workspace: ${{ steps.filter.outputs.workspace }}
contracts: ${{ steps.filter.outputs.contracts }}
ipc: ${{ steps.filter.outputs.ipc }}
ipld-resolver: ${{ steps.filter.outputs.ipld-resolver }}
fendermint: ${{ steps.filter.outputs.fendermint }}
steps:
# For pull requests it's not necessary to checkout the code,
# but the workflow is also triggered on pushes to `main`.
- uses: actions/checkout@v3

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
workspace:
- 'Cargo.toml'
contracts:
- 'contracts/**'
ipc:
- 'ipc/**'
ipld-resolver:
- 'ipld/resolver/**'
fendermint:
- 'fendermint/**'

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

contracts-prettier:
uses: ./.github/workflows/contracts-prettier.yaml
needs: [changes]
if: >-
needs.changes.outputs.contracts == 'true' ||
github.ref == 'refs/heads/main' ||
github.ref_type == 'tag'

contracts-deployment-test:
uses: ./.github/workflows/contracts-deployment-test.yaml
needs: [ contracts-prettier ]
needs: [contracts-prettier]

contracts-test:
uses: ./.github/workflows/contracts-test.yaml
Expand All @@ -79,9 +42,12 @@ jobs:
uses: ./.github/workflows/contracts-storage.yaml
needs: [contracts-prettier]

contracts-pnpm-audit:
uses: ./.github/workflows/contracts-pnpm-audit.yaml
needs: [contracts-prettier]
## This causes too much unpredictable noise, turning our builds red whenever a new vulnerability is found.
## It's better to have a separate workflow for auditing, and have it run on a schedule.
## However, given this code is purely used for tooling and not for production, it's not a big deal.
# contracts-pnpm-audit:
# uses: ./.github/workflows/contracts-pnpm-audit.yaml
# needs: [contracts-prettier]

contracts-sast:
uses: ./.github/workflows/contracts-sast.yaml
Expand All @@ -91,53 +57,33 @@ jobs:
uses: ./.github/workflows/extras.yaml
needs: [contracts-prettier]

ipc:
uses: ./.github/workflows/ipc.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you want to delete ipc.yaml?

needs: [changes, license]
if: >-
needs.changes.outputs.workspace == 'true' ||
needs.changes.outputs.contracts == 'true' ||
needs.changes.outputs.ipc == 'true' ||
github.ref == 'refs/heads/main' ||
github.ref_type == 'tag'
build:
uses: ./.github/workflows/build.yaml
needs: [license]

ipld-resolver:
uses: ./.github/workflows/ipld-resolver.yaml
needs: [changes, license]
if: >-
needs.changes.outputs.workspace == 'true' ||
needs.changes.outputs.ipld-resolver == 'true' ||
github.ref == 'refs/heads/main' ||
github.ref_type == 'tag'
unit-tests:
uses: ./.github/workflows/tests-unit.yaml
secrets: inherit
needs:
- build

fendermint-test:
uses: ./.github/workflows/fendermint-test.yaml
e2e-tests:
uses: ./.github/workflows/tests-e2e.yaml
secrets: inherit
needs: [changes, license]
if: >-
needs.changes.outputs.workspace == 'true' ||
needs.changes.outputs.contracts == 'true' ||
needs.changes.outputs.ipc == 'true' ||
needs.changes.outputs.ipld-resolver == 'true' ||
needs.changes.outputs.fendermint == 'true' ||
github.ref == 'refs/heads/main' ||
github.ref_type == 'tag'
needs:
- build

fevm-contract-tests:
uses: ./.github/workflows/fevm-contract-tests.yaml
secrets: inherit
needs: [changes, license]
needs:
- build
if: >-
needs.changes.outputs.workspace == 'true' ||
needs.changes.outputs.contracts == 'true' ||
needs.changes.outputs.ipc == 'true' ||
needs.changes.outputs.ipld-resolver == 'true' ||
needs.changes.outputs.fendermint == 'true' ||
github.ref == 'refs/heads/main' ||
github.ref_type == 'tag'

fendermint-publish:
uses: ./.github/workflows/fendermint-publish.yaml
docker-publish:
uses: ./.github/workflows/docker-publish.yaml
secrets: inherit
# Dependencies are not strictly necessary, but if fendermint tests pass they publish docker too, so they better work.
# It is because of these needs that all the filters are allowed to run on `main` too, otherwise this would be disabled.
Expand All @@ -148,6 +94,6 @@ jobs:
github.ref_type == 'tag'
needs:
- contracts-test # generates the ABI artifacts (although fendermint can do on its own too)
- ipc
- ipld-resolver
- fendermint-test
- build
- unit-tests
- e2e-tests
2 changes: 1 addition & 1 deletion .github/workflows/contracts-deployment-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deployment Test
name: 'Contracts: Smoke test deployment'

# This workflow is triggered from the main CI workflow.
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contracts-pnpm-audit.yaml
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:
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/contracts-prettier.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# .github/workflows/prettier.yml
name: Prettier

name: 'Contracts: Prettier'

# This workflow is triggered from the main CI workflow.
on:
Expand All @@ -8,30 +8,23 @@ on:
jobs:
prettier:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2

- name: Set up node.js
uses: actions/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'

- name: Run formatter
run: cd contracts && make fmt

- name: Check diff clean
run: |
git status
git diff --name-only
git --no-pager diff --quiet

# - name: Commit changes
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: Apply Prettier formatting
# branch: ${{ github.head_ref }}
2 changes: 1 addition & 1 deletion .github/workflows/contracts-sast.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Static analysis
name: 'Contracts: Static analysis'

# This workflow is triggered from the main CI workflow.
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contracts-storage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Storage check
name: 'Contracts: Storage check'

# This workflow is triggered from the main CI workflow.
on:
Expand Down
Loading