From 9bd89b9646958efbfa7959928126e09b9a37af8e Mon Sep 17 00:00:00 2001 From: Jennifer Date: Thu, 10 Oct 2024 11:23:57 +0100 Subject: [PATCH] Add CI to run forge build and test (#7) * Add CI to run forge build and test * Rename to odyssey config --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ chapter1/foundry.toml | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..15a7481 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: test + +on: + pull_request: + merge_group: + push: + branches: [main] + +env: + FOUNDRY_PROFILE: ci + +jobs: + check: + strategy: + fail-fast: true + matrix: + chapter: [chapter1] + + name: Foundry project - ${{ matrix.chapter }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Run Forge build + id: build + working-directory: ./${{ matrix.chapter }} + run: forge build + + - name: Run Forge test + id: test + working-directory: ./${{ matrix.chapter }} + run: forge test diff --git a/chapter1/foundry.toml b/chapter1/foundry.toml index 2c53aca..d3aede6 100644 --- a/chapter1/foundry.toml +++ b/chapter1/foundry.toml @@ -6,4 +6,4 @@ cache_path = "contracts/cache" libs = ["contracts/lib"] eof = true -odyssey = true +odyssey = true \ No newline at end of file