-
Notifications
You must be signed in to change notification settings - Fork 285
57 lines (56 loc) · 1.76 KB
/
build_and_test_website.yml
File metadata and controls
57 lines (56 loc) · 1.76 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
# Simple workflow for Building and Testing the Pyrefly Website
# If upload_artifacts is true, the build artifacts will be uploadeded.
name: Build and Test Pyrefly Website
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow this workflow to be called by other workflows
workflow_call:
inputs:
upload_artifacts:
description: 'Whether to upload artifacts after build'
required: false
default: false
type: boolean
push:
branches: [ main ]
pull_request:
types: [opened]
paths:
- 'website/**'
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Node.js version
uses: actions/setup-node@v6
with:
node-version: "20.x"
- name: Install yarn deps
run: cd website && yarn install
- name: Install wasm-pack
run: cargo install wasm-pack wasm-opt
- name: Use rust nightly
run: rustup install nightly && rustup default nightly
- name: Build
working-directory: ./website
run: cargo version && chmod +x scripts/build.sh && scripts/build.sh && yarn build-wasm-for-test
- name: Typecheck
working-directory: ./website
run: yarn tsc --noEmit
- name: Test
working-directory: ./website
run: yarn test
- name: Get current date
id: date
if: ${{ inputs.upload_artifacts }}
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Upload build artifacts
if: ${{ inputs.upload_artifacts }}
uses: actions/upload-artifact@v6
with:
name: website-build-${{ env.date }}
path: website/build
retention-days: 30