From df7ec47d6643f58379de4fa5574bf6e3a61585e7 Mon Sep 17 00:00:00 2001 From: Mateo Rico <89949621+ricomateo@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:10:15 -0300 Subject: [PATCH] ci: add job to check the contracts are formatted and can be compiled (#471) --- .github/workflows/contracts.yml | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/contracts.yml diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml new file mode 100644 index 000000000..ba932e2f8 --- /dev/null +++ b/.github/workflows/contracts.yml @@ -0,0 +1,40 @@ +name: Contracts CI + +on: + push: + branches: [main] + pull_request: + branches: [ '**' ] + +env: + FOUNDRY_PROFILE: ci + +jobs: + check: + strategy: + fail-fast: true + + name: Foundry project + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./contracts + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: stable + + - name: Show Forge version + run: forge --version + + - name: Run Forge fmt + run: forge fmt --check + + - name: Run Forge build + run: forge build