Fix working directories #513
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }} |