Skip to content

Commit

Permalink
chore(pipeline): run build of github pages on pullRequests (#3607)
Browse files Browse the repository at this point in the history
Co-authored-by: Morgan Bazalgette <[email protected]>
  • Loading branch information
Villaquiranm and thehowl authored Feb 4, 2025
1 parent 8410060 commit 6fe3b31
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# generate Go docs and publish on gh-pages branch
# Live at: https://gnolang.github.io/gno
name: Go Reference Docs Deployment
name: GitHub pages (godoc & stdlib_diff) build and deploy

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

permissions:
Expand All @@ -19,29 +22,39 @@ concurrency:

jobs:
build:
if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions.
if: github.repository == 'gnolang/gno' # Alternatively, validate based on provided tokens and permissions.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: echo "GOROOT=$(go env GOROOT)" >> $GITHUB_ENV
- run: echo $GOROOT
# Use the goroot at the top of the project to compare with the GnoVM
# stdlib, rather than the one in stdlib_diff (which may have a go.mod with
# a different toolchain version).
- 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"
- 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

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
Expand Down
4 changes: 3 additions & 1 deletion misc/stdlib_diff/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all: clean gen

GOROOT_SAVE ?= $(shell go env GOROOT)

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
4 changes: 2 additions & 2 deletions misc/stdlib_diff/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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.

## Usage

Expand All @@ -27,4 +27,4 @@ Compare the `gno` standard libraries the `go` standard libraries

## Tips

An index.html is generated at the root of the report location. Utilize it to navigate easily through the report.
An index.html is generated at the root of the report location. Utilize it to navigate easily through the report.

0 comments on commit 6fe3b31

Please sign in to comment.