Using GH actions, no need for uploading artifact #93
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: Smashtests | |
# Trigger this workflow only when the main branches, assets folder is modified. | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to get repo contents | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Npm Install | |
run: npm install | |
# If GH_GIST_TOKEN doesn't exist, empty value gets passed. | |
# Unauthenticated call gets made to Gist API which can result in rate limits, | |
# Especially in Github Actions | |
- name: Start serving the static site | |
run: npm --silent run start --gisttoken=${{ secrets.GH_GIST_TOKEN }} --githubtoken=${{ secrets.GITHUB_TOKEN }} & | |
- name: Run Smashtests | |
run: npm --silent test | |
- name: Kill the web server | |
#run: /bin/bash -c "killall -9 node" | |
#run: kill -9 $(lsof -t -i :8080) | |
run: npm stop | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: smashtest-report | |
path: tests/smashtest | |
retention-days: 7 |