-
Notifications
You must be signed in to change notification settings - Fork 27
117 lines (102 loc) · 3.26 KB
/
main.yaml
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
name: build
on:
push:
branches: [ '*' ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
name: Test and Deploy Playground
steps:
# Checkout the content from the `releases` branch
- name: Checkout releases branch
uses: actions/checkout@v3
with:
ref: releases
path: base_content
# Checkout the current branch (to get the latest changes)
- name: Checkout current branch
uses: actions/checkout@v3
with:
path: current_branch
# Install Ruby for Jekyll
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- run: |
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$PATH"
gem install jekyll bundler
# Set up Bun for JavaScript dependencies
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
# Install Java
- name: install java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
# Set up Node.js
- uses: actions/setup-node@v3
with:
node-version: 18
# Install dependencies for sof-js
- name: Install dependencies
working-directory: current_branch/sof-js
run: bun install
# Run code formatting checks
- name: Check formatting
working-directory: current_branch/sof-js
run: bun run check-fmt
# Validate JSON tests
- name: Validate JSON tests
working-directory: current_branch/sof-js
run: bun run validate
# Run tests
- name: Run tests
working-directory: current_branch/sof-js
run: bun run test
continue-on-error: true
# Build test report and output to playground directory
- name: Build test report
working-directory: current_branch/test_report
run: |
bun install
bun run prepare
bun run build
# Copy test_report output to the playground directory in the base content
- run: |
mkdir -p base_content/playground
cp -R current_branch/test_report/public/* base_content/playground/
# Build IG and output to ig/latest directory
- name: Build IG
working-directory: current_branch
run: |
export GEM_HOME="$HOME/gems"
export PATH="$HOME/gems/bin:$HOME/.bun/bin:$PATH"
bun i -g fsh-sushi
./scripts/_updatePublisher.sh -y
./scripts/_genonce.sh
# Copy IG output to the ig/latest directory in the base content
- run: |
mkdir -p base_content/ig/latest
cp -R output/* base_content/ig/latest/
# Set up Pages for deployment
- name: Setup Pages
uses: actions/configure-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
# Upload the artifact (base_content) for deployment
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
if: ${{ github.ref == 'refs/heads/master' }}
with:
path: 'base_content'
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
if: ${{ github.ref == 'refs/heads/master' }}