Skip to content

vitests force no failed tests, updated deployment added vittest to CI #10

vitests force no failed tests, updated deployment added vittest to CI

vitests force no failed tests, updated deployment added vittest to CI #10

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ['main']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
setup:
name: Common Setup
runs-on: ubuntu-latest
outputs:
page_url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
uses: microsoft/playwright-github-action@v1
test:
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
browser: [chromium, firefox, webkit]
steps:
- name: Run Vitest (unit tests)
run: npm run test:unit
# - name: Run Playwright Tests
# run: npm run test:e2e
# - name: Run Playwright tests
# run: npx playwright test
env:
CI: true
deploy:
needs: [setup, test]
environment:
name: github-pages
url: ${{ needs.setup.outputs.page_url }}
runs-on: ubuntu-latest
steps:
# - name: Build the project
# run: npm run build
- name: Configure Pages
uses: actions/configure-pages@v4
- name: Upload GitHub Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4