Tests and prepares build for deploying #13
Workflow file for this run
This file contains hidden or 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: test-and-build | |
run-name: Tests and prepares build for deploying | |
concurrency: | |
group: '${{ github.workflow }}' | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arduino/setup-task@v2 | |
- name: Prepare env | |
run: task -d .ci env | |
- name: 'Cache node_modules: check' | |
uses: actions/cache/restore@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
docs/node_modules | |
lib/node_modules | |
key: node-modules-${{ hashFiles('yarn.lock', 'docs/yarn.lock', 'lib/yarn.lock') }} | |
- if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
name: 'Cache node_modules doesn''t exist: install' | |
run: task -d .ci yarn | |
- if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
name: 'Cache node_modules doesn''t exist: save node_modules to cache' | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
node_modules | |
docs/node_modules | |
lib/node_modules | |
key: node-modules-${{ hashFiles('yarn.lock', 'docs/yarn.lock', 'lib/yarn.lock') }} | |
- name: Build | |
run: task -d .ci build | |
- name: Runs server | |
run: task -d .ci up | |
- name: Tests | |
run: task -d .ci test | |
- name: 'Uploads ''frontend/dist'' artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
path: docs/dist | |
name: docs-dist |