From a254218b95b8c4c1e5b8536368e5249a2aac026a Mon Sep 17 00:00:00 2001 From: Miguel Victoria Date: Fri, 24 Jan 2025 22:48:35 +0100 Subject: [PATCH 1/4] run build of github pages on pullRequests --- .github/workflows/gh-pages.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index a293469bb5d..409f3ed5adb 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -6,6 +6,9 @@ on: push: branches: - master + pull_request: + branches: + - master workflow_dispatch: permissions: @@ -41,7 +44,7 @@ jobs: path: ./pages_output deploy: - if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions. + if: ${{ github.repository == 'gnolang/gno' && github.ref == 'refs/heads/master' && github.event_name == 'push' }} runs-on: ubuntu-latest environment: name: github-pages From 728fe7e3f95f296dfb7f7063854e9d0064eef7e0 Mon Sep 17 00:00:00 2001 From: Miguel Victoria Date: Fri, 24 Jan 2025 22:55:59 +0100 Subject: [PATCH 2/4] change GOROOT -> GOROOT_SAVE --- .github/workflows/gh-pages.yml | 3 +-- misc/stdlib_diff/Makefile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 409f3ed5adb..33450b5eb77 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -29,8 +29,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version-file: go.mod - - run: echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV - - run: echo $GOROOT + - run: echo "GOROOT_SAVE=$(go env GOROOT)" >> $GITHUB_ENV - run: "cd misc/stdlib_diff && make gen" - run: "cd misc/gendocs && make install gen" - run: "mkdir -p pages_output/stdlib_diff" diff --git a/misc/stdlib_diff/Makefile b/misc/stdlib_diff/Makefile index 439af22c586..28e5c9f79c0 100644 --- a/misc/stdlib_diff/Makefile +++ b/misc/stdlib_diff/Makefile @@ -1,7 +1,7 @@ all: clean gen gen: - go run . -src $(GOROOT)/src -dst ../../gnovm/stdlibs -out ./stdlib_diff + go run . -src $(GOROOT_SAVE)/src -dst ../../gnovm/stdlibs -out ./stdlib_diff clean: rm -rf stdlib_diff From 381c0d8d312682f221f28d7724d8432658127232 Mon Sep 17 00:00:00 2001 From: Miguel Victoria Date: Fri, 24 Jan 2025 23:04:51 +0100 Subject: [PATCH 3/4] Add toolchain mention the stdlibs_diff readme --- misc/stdlib_diff/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/stdlib_diff/README.md b/misc/stdlib_diff/README.md index 32c3cbcd93d..6f4cdae6b74 100644 --- a/misc/stdlib_diff/README.md +++ b/misc/stdlib_diff/README.md @@ -1,6 +1,8 @@ # stdlibs_diff -stdlibs_diff is a tool that generates an html report indicating differences between gno standard libraries and go standrad libraries +stdlibs_diff is a tool that generates an html report indicating differences between gno standard libraries and go standard libraries. + +⚠️ When using goenv to set the src or the destination, the Go version will be the one from the toolchain on go.mod. ## Usage From 1d4d7f9589a0167d0f231425b40675495c08a448 Mon Sep 17 00:00:00 2001 From: Miguel Victoria Date: Fri, 24 Jan 2025 23:09:25 +0100 Subject: [PATCH 4/4] avoid publishing artifacts on pull requests --- .github/workflows/gh-pages.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 33450b5eb77..8c353d510a9 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -36,9 +36,14 @@ jobs: - run: | cp -r misc/gendocs/godoc/* pages_output/ cp -r misc/stdlib_diff/stdlib_diff/* pages_output/stdlib_diff/ + + # These two last steps will be skipped on pull requests - uses: actions/configure-pages@v5 id: pages + if: github.event_name != 'pull_request' + - uses: actions/upload-pages-artifact@v3 + if: github.event_name != 'pull_request' with: path: ./pages_output