ci: wip #15
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: Unit Tests (Vitest) | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
discussions: write | |
issues: write | |
packages: write | |
pages: write | |
pull-requests: write | |
repository-projects: write | |
security-events: read | |
statuses: write | |
jobs: | |
test: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
run: | | |
docker build -t sveltex/test-environment:latest -f ./docker/Dockerfile . | |
- name: Install Node.js dependencies | |
run: | | |
npm install -g pnpm | |
pnpm install | |
- name: Run Unit Tests in Docker container | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/app -w /app sveltex/test-environment:latest pnpm test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: vitest-report | |
path: vitest-report/ | |
retention-days: 30 |