ci: add solidity formatting check and tweak go wrappers CI check #278
Workflow file for this run
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
name: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- release/** | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" | |
forge-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Check formatting | |
working-directory: ./ | |
run: forge fmt --check | |
- name: Run forge test | |
working-directory: ./ | |
run: forge test | |
go-wrapper-check: | |
runs-on: ubuntu-latest | |
needs: forge-test | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "=1.19.0" | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- name: Install Go Ethereum devtools | |
working-directory: ./ | |
run: | | |
git clone --depth 1 --branch v1.12.0 https://github.com/ethereum/go-ethereum.git | |
cd go-ethereum | |
make devtools | |
- name: Make Go wrapper | |
working-directory: ./ | |
run: make | |
- name: Check Go wrapper match | |
run: | | |
if [ "$(git diff --ignore-space-at-eol wrappers | wc -l)" -gt "0" ]; then | |
echo "Detected uncommitted changes after build. See status below:" | |
git diff | |
exit 1 | |
fi |