From ce3c5ea3e9e14751a0c06713329ba0365a0bc4eb Mon Sep 17 00:00:00 2001 From: akshaynexus Date: Sat, 23 Mar 2024 09:11:50 +0300 Subject: [PATCH] fix: diffrent ci method --- .github/workflows/PRAutoTest.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/PRAutoTest.yml b/.github/workflows/PRAutoTest.yml index 1356b669..62891b91 100644 --- a/.github/workflows/PRAutoTest.yml +++ b/.github/workflows/PRAutoTest.yml @@ -3,8 +3,10 @@ on: pull_request: paths: - 'src/test/*_exp.sol' + env: FOUNDRY_PROFILE: ci + jobs: check: strategy: @@ -15,15 +17,19 @@ jobs: - uses: actions/checkout@v3 with: submodules: recursive - fetch-depth: 0 # Required to fetch all branches + fetch-depth: 0 # Required to fetch all branches + - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: version: nightly + - name: Run Forge tests run: | shopt -s nullglob - changed_files=$(git diff --name-only ${{ github.base_ref }} HEAD) + base_sha=${{ github.event.pull_request.base.sha }} + head_sha=${{ github.event.pull_request.head.sha }} + changed_files=$(git diff --name-only $base_sha $head_sha) for file in $changed_files; do if [[ $file == src/test/*_exp.sol ]]; then forge test --contracts "$file" -vvv