From f7bb47c952f4d90995fff382e7b523e470f91f1d Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 15:06:44 +0800 Subject: [PATCH 1/6] enable github test action --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09880b1d..eeb4a811 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,13 @@ name: test -on: workflow_dispatch +on: + pull_request: + push: + branches: + - main + - release/** + tags: + - "*" env: FOUNDRY_PROFILE: ci From 4cd22d20a8b30c8a2a1e2ec0d5cb3928a8568c92 Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 15:20:48 +0800 Subject: [PATCH 2/6] use previous version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eeb4a811..bc611071 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly + version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9 - name: Run Forge build run: | From 85cb117fc2f6a03292d3ed1e556b5b5c73b9101a Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 15:29:34 +0800 Subject: [PATCH 3/6] add comment about nightly version --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bc611071..d6bee708 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,8 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: + # replace nightly because latest nightly release has some breaking changes that result in test failures + # this is a previous recent nightly release that should work version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9 - name: Run Forge build From 541b379cb57031e19ebeaab36a4531e92a5aef4b Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 16:06:13 +0800 Subject: [PATCH 4/6] comment when action failed --- .github/workflows/test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d6bee708..34668e8b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,9 +27,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - # replace nightly because latest nightly release has some breaking changes that result in test failures - # this is a previous recent nightly release that should work - version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9 + version: stable - name: Run Forge build run: | @@ -41,3 +39,16 @@ jobs: run: | forge test -vvv id: test + + - name: Add comment on failure + if: failure() + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'The GitHub Actions workflow has failed. Please check the logs for more details.' + }) From 9e638734e6c19eeae2ce5f559de7dac8e8fd9a98 Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 16:21:35 +0800 Subject: [PATCH 5/6] use specific nightly version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34668e8b..dc43a4b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: stable + version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9 - name: Run Forge build run: | From c16162f61f709498e2fee719f0b4c6b352d99fb8 Mon Sep 17 00:00:00 2001 From: adu Date: Mon, 3 Jun 2024 16:24:47 +0800 Subject: [PATCH 6/6] comment on nightly version --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc43a4b5..e85fdb1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,8 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: + # replace nightly because latest nightly release has some breaking changes that result in test failures + # this is a previous recent nightly release that should work version: nightly-f625d0fa7c51e65b4bf1e8f7931cd1c6e2e285e9 - name: Run Forge build