@@ -11,49 +11,105 @@ jobs:
11
11
runs-on : ubuntu-latest
12
12
name : Test and Deploy Playground
13
13
steps :
14
- - uses : actions/checkout@v3
14
+ # Checkout the content from the `releases` branch
15
+ - name : Checkout releases branch
16
+ uses : actions/checkout@v3
17
+ with :
18
+ ref : releases
19
+ path : base_content
20
+
21
+ # Checkout the current branch (to get the latest changes)
22
+ - name : Checkout current branch
23
+ uses : actions/checkout@v3
24
+ with :
25
+ path : current_branch
26
+
27
+ # Install Ruby for Jekyll
15
28
- uses : ruby/setup-ruby@v1
16
29
with :
17
30
ruby-version : ' 3.0'
18
- - run : export GEM_HOME="$HOME/gems" && export PATH="$HOME/gems/bin:$PATH" && gem install jekyll bundler
19
- - run : export GEM_HOME="$HOME/gems" && export PATH="$HOME/gems/bin:$PATH" && jekyll -h
31
+
32
+ - run : |
33
+ export GEM_HOME="$HOME/gems"
34
+ export PATH="$HOME/gems/bin:$PATH"
35
+ gem install jekyll bundler
36
+
37
+ # Set up Bun for JavaScript dependencies
20
38
- uses : oven-sh/setup-bun@v1
21
39
with :
22
40
bun-version : latest
41
+
42
+ # Install Java
23
43
- name : install java
24
44
uses : actions/setup-java@v3
25
45
with :
26
46
distribution : ' adopt'
27
47
java-version : 17
48
+
49
+ # Set up Node.js
28
50
- uses : actions/setup-node@v3
29
51
with :
30
52
node-version : 18
53
+
54
+ # Install dependencies for sof-js
31
55
- name : Install dependencies
32
56
working-directory : sof-js
33
57
run : bun install
58
+
59
+ # Run code formatting checks
34
60
- name : Check formatting
35
61
working-directory : sof-js
36
62
run : bun run check-fmt
63
+
64
+ # Validate JSON tests
37
65
- name : Validate JSON tests
38
66
working-directory : sof-js
39
67
run : bun run validate
68
+
69
+ # Run tests
40
70
- name : Run tests
41
71
working-directory : sof-js
42
72
run : bun run test
43
73
continue-on-error : true
74
+
75
+ # Build test report and output to playground directory
44
76
- name : Build test report
45
77
working-directory : test_report
46
- run : bun install && bun run prepare && bun run build
78
+ run : |
79
+ bun install
80
+ bun run prepare
81
+ bun run build
82
+ # Copy test_report output to the playground directory in the base content
83
+ - run : |
84
+ mkdir -p base_content/playground
85
+ cp -R test_report/public/* base_content/playground/
86
+
87
+ # Build IG and output to ig/latest directory
47
88
- name : Build IG
48
- 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 && cp -R test_report/public output/extra
89
+ run : |
90
+ export GEM_HOME="$HOME/gems"
91
+ export PATH="$HOME/gems/bin:$HOME/.bun/bin:$PATH"
92
+ bun i -g fsh-sushi
93
+ ./scripts/_updatePublisher.sh -y
94
+ ./scripts/_genonce.sh
95
+ # Copy IG output to the ig/latest directory in the base content
96
+ - run : |
97
+ mkdir -p base_content/ig/latest
98
+ cp -R output/* base_content/ig/latest/
99
+
100
+ # Set up Pages for deployment
49
101
- name : Setup Pages
50
102
uses : actions/configure-pages@v3
51
103
if : ${{ github.ref == 'refs/heads/master' }}
104
+
105
+ # Upload the artifact (base_content) for deployment
52
106
- name : Upload artifact
53
107
uses : actions/upload-pages-artifact@v2
54
108
if : ${{ github.ref == 'refs/heads/master' }}
55
109
with :
56
- path : ' output'
110
+ path : ' base_content'
111
+
112
+ # Deploy to GitHub Pages
57
113
- name : Deploy to GitHub Pages
58
114
id : deployment
59
115
uses : actions/deploy-pages@v2
0 commit comments