-
Notifications
You must be signed in to change notification settings - Fork 25
113 lines (92 loc) · 2.6 KB
/
build-explorer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build Explorer UI
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
pages: write
id-token: write
jobs:
build_explorer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
standalone: true
package_json_file: 'ui/package.json'
version: latest
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
check-latest: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
cache: 'pip'
cache-dependency-path: 'scripts/requirements.txt'
- name: Install node dependencies
working-directory: ./ui
run: |
pnpm install
- name: Setup Binaryen
# fixme: use acifani/setup-tinygo after pr acceptance
uses: Zxilly/setup-tinygo@main
with:
install-tinygo: false
binaryen-version: '117'
- name: Add python dependencies
run: |
pip install -r scripts/requirements.txt
- name: Download deps
run: go mod download
- name: Build wasm
run: |
python scripts/wasm.py
- name: Build
working-directory: ./ui
run: pnpm run build:explorer
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
PULL_REQUEST_COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'ui/dist/explorer/'
deploy:
if: ${{ github.event_name == 'push' }}
needs: build_explorer
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4