-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (118 loc) · 3.68 KB
/
Copy pathpages.yml
File metadata and controls
144 lines (118 loc) · 3.68 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# GitHub Pages deployment for DuoPulse site with Pattern Evaluation Dashboard
name: Build & Deploy Site
on:
# Run on pushes to main
push:
branches: [main]
paths:
- 'site/**'
- 'tools/evals/**'
- 'src/Engine/**'
- 'tools/pattern_viz.cpp'
- '.github/workflows/pages.yml'
# Run tests on PRs
pull_request:
branches: [main]
paths:
- 'site/**'
- 'tools/evals/**'
- 'src/Engine/**'
- 'tools/pattern_viz.cpp'
- '.github/workflows/pages.yml'
# Allow manual trigger
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Run tests first
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential catch2
- name: Run unit tests
run: make test
# Build and deploy site
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Build pattern_viz
run: make pattern-viz
- name: Generate evaluation data
run: make evals-generate
- name: Run evaluations
run: make evals-evaluate
- name: Generate sensitivity matrix
run: make sensitivity-matrix
- name: Extract metrics history
run: make metrics-history
- name: Parse iteration logs
run: node scripts/iterate/parse-iterations.js
- name: Update baseline
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
node scripts/update-baseline.js --metrics=tools/evals/public/data/expressiveness.json
- name: Configure git for tagging
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Tag baseline
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
bash scripts/tag-baseline.sh --push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# NOTE: baseline.json updates are NOT auto-committed due to branch protection
# on main. Baseline tags are created above. To update baseline.json in the
# repo, manually commit and create a PR.
- name: Assemble site
run: |
# Create build directory
mkdir -p _site
# Copy landing page
cp site/index.html _site/
cp site/styles.css _site/
# Copy evals to /evals subdirectory
mkdir -p _site/evals
cp -r tools/evals/public/* _site/evals/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
deploy:
# Only deploy on push to main, not on PRs
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4