From 1c851f5d506371a52059f291612d904edf131bac Mon Sep 17 00:00:00 2001 From: Antonio Guilherme Ferreira Viggiano Date: Mon, 4 Dec 2023 15:38:16 +0100 Subject: [PATCH] Create CI workflow --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 34 -------------------------- 2 files changed, 50 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f586f3d9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: + - develop + pull_request: + branches: + - "*" + +jobs: + check: + strategy: + fail-fast: true + + name: CI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Contract sizes + run: | + forge --version + forge build --sizes + id: build + + - name: Test + run: | + forge test -vvv + id: test + + - name: Coverage + run: | + forge coverage --report lcov + lcov --remove lcov.info -o lcov.info 'test/*' 'script/*' + genhtml lcov.info -o report --branch-coverage + id: coverage + + - name: Archive results + uses: actions/upload-artifact@v3 + with: + name: coverage + path: report/ \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 09880b1d..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: test - -on: workflow_dispatch - -env: - FOUNDRY_PROFILE: ci - -jobs: - check: - strategy: - fail-fast: true - - name: Foundry project - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Run Forge build - run: | - forge --version - forge build --sizes - id: build - - - name: Run Forge tests - run: | - forge test -vvv - id: test