Add Test Coverage and UI #16
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: Test and Build the Application | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.11.1" | |
- name: Load & cache dependencies | |
uses: ./.github/actions/cached-deps | |
- name: Run the linter | |
run: npm run lint -- --max-warnings=0 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.11.1" | |
- name: Load & cache dependencies | |
uses: ./.github/actions/cached-deps | |
- name: Run tests | |
run: npm test | |
build: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.11.1" | |
- name: Load & cache dependencies | |
uses: ./.github/actions/cached-deps | |
id: chached-deps | |
- name: Build the application | |
run: npm run build | |
- name: Upload artifacts | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-files | |
path: dist | |
report: | |
runs-on: ubuntu-latest | |
needs: [lint, build] | |
if: failure() | |
steps: | |
- name: Output information | |
run: | | |
echo "Something went wrong!" | |
echo "${{ toJson(github)}}" |