Skip to content

fix: foundry contract size nightly issue #339

fix: foundry contract size nightly issue

fix: foundry contract size nightly issue #339

Workflow file for this run

name: Solidity based workflow
on:
push:
branches:
- main
pull_request:
jobs:
format-lint:
name: Format and lint
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
steps:
- uses: step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: audit
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/install-deps
- name: Formatting check Solidity
id: formatter-check-solidity
run: npx prettier --check --plugin=prettier-plugin-solidity '{src,script,test}/**/*.sol'
- name: Linting Solidity
run: npx solhint '{src,script,test}/**/*.sol'
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@v2
with:
disable-sudo: false
egress-policy: audit
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/install-deps
- name: Run Forge build
run: |
forge --version
forge build --sizes
- name: Run Forge tests
run: forge test -vvv
- name: Run snapshot
run: forge snapshot --check
- name: Run forge coverage
run: NO_COLOR=1 forge coverage --report summary >> $GITHUB_STEP_SUMMARY
docker-build:
name: Build Docker images
runs-on: ubuntu-latest
needs: [ format-lint, build-test, static-analysis ]
strategy:
fail-fast: false
matrix:
arch: ['amd64']
steps:
- uses: step-security/harden-runner@v2
with:
disable-sudo: false
egress-policy: audit
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Check docker config and disable live reload
run: |
cat /etc/docker/daemon.json
echo '{ "live-restore": false }' | sudo tee /etc/docker/daemon.json
sudo systemctl reload docker
make check-swarm-init
- name: Build and load
run: |
mkdir export
make docker-build ARGS='--set "*.cache-from=type=gha" \
--set "*.platform=linux/${{ matrix.arch }}" \
--builder ${{ steps.buildx.outputs.name }} \
--set "eth.output=type=tar,dest=export/eth.tar"'
- name: Test
timeout-minutes: 5
run: |
make docker-local
make docker-remove
- name: Dump logs
if: always()
run: |
make docker-logs || true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docker-images-${{ matrix.arch }}
path: export
retention-days: 1
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: step-security/harden-runner@v2
with:
disable-sudo: false
egress-policy: audit
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Analyze using Slither
uses: crytic/[email protected]
id: slither
with:
sarif: results.sarif
node-version: '20.10'
fail-on: none
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.slither.outputs.sarif }}
e2e-tests:
name: E2E tests
needs: docker-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: ['amd64']
env:
PANTOS_ETHEREUM_CONTRACTS: ${{ github.workspace }}/ethereum-contracts
steps:
- uses: actions/checkout@v4
with:
path: ${{ env.PANTOS_ETHEREUM_CONTRACTS }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: buildx
- name: Check docker config and disable live reload
working-directory: ${{ env.PANTOS_ETHEREUM_CONTRACTS }}
run: |
FILE=/etc/docker/daemon.json
if [[ -f "$FILE" ]]; then
touch $FILE
fi
echo '{ "live-restore": false }' | sudo tee /etc/docker/daemon.json
sudo systemctl reload docker
make check-swarm-init
- name: Build and load
working-directory: ${{ env.PANTOS_ETHEREUM_CONTRACTS }}
run: |
make docker-build ARGS='--set "*.cache-from=type=gha" \
--set "*.platform=linux/${{ matrix.arch }}" \
--builder ${{ steps.buildx.outputs.name }} \
--load'
- uses: pantos-io/e2e-testing/.github/actions/run-tests@main
with:
ethereum-contracts-path: ${{ env.PANTOS_ETHEREUM_CONTRACTS }}
ethereum-contracts-version: 'local'