From 731e469a8389c481125e52db346ee1c74c43071c Mon Sep 17 00:00:00 2001 From: Artem Storozhuk Date: Fri, 21 Jun 2024 14:29:44 +0100 Subject: [PATCH] feat: Add CI configuration for Solidity --- .github/workflows/solidity.yml | 40 ++++++++++++++++++++++++++++++++++ aptos/solidity/README.md | 5 +++++ 2 files changed, 45 insertions(+) create mode 100644 .github/workflows/solidity.yml diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml new file mode 100644 index 00000000..4213cd9c --- /dev/null +++ b/.github/workflows/solidity.yml @@ -0,0 +1,40 @@ +name: Solidity + +on: + merge_group: + push: + branches: + - "main" + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + +jobs: + jobs: + unit-tests: + name: Unit Tests + runs-on: buildjet-16vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Check formatting + run: | + forge fmt --check + working-directory: ${{ github.workspace }}/aptos/solidity/contracts/ + + - name: Run Forge build + run: | + forge --version + forge build + working-directory: ${{ github.workspace }}/aptos/solidity/contracts/ + + - name: Run Forge tests + run: | + forge test + working-directory: ${{ github.workspace }}/aptos/solidity/contracts/ diff --git a/aptos/solidity/README.md b/aptos/solidity/README.md index c3d609de..b0fac081 100644 --- a/aptos/solidity/README.md +++ b/aptos/solidity/README.md @@ -53,3 +53,8 @@ And you can re-run Solidity tests with newer fixture: ``` % cd solidity/contracts && forge test ``` + +P.S.: You might be encountering issue with updating `sphinx-contracts` Foundry dependency, in this case try manually specifying accessing the submodule via SSH +``` +git config submodule.aptos/solidity/contracts/lib/sphinx-contracts.url git@github.com:lurk-lab/sphinx-contracts +```