mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-19 21:31:00 -07:00
89 lines
2 KiB
YAML
89 lines
2 KiB
YAML
name: Test
|
|
|
|
on:
|
|
workflow_call:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'docs/**'
|
|
- '.vscode'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
- 'README.md'
|
|
- '.vscode'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 'latest'
|
|
run_install: false
|
|
- name: Cache dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
**/node_modules
|
|
~/.pnpm-store
|
|
~/.npm
|
|
key: test-${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
test-${{ runner.os }}-node-
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
|
|
- name: Run linting
|
|
run: pnpm run lint
|
|
continue-on-error: true
|
|
|
|
- name: Run unit tests
|
|
run: pnpm run test:unit
|
|
|
|
- name: Build plugins
|
|
run: pnpm run build:plugin
|
|
|
|
- name: Package for testing
|
|
run: pnpm run package
|
|
|
|
- name: Run e2e tests
|
|
run: pnpm run test:e2e
|
|
env:
|
|
CI: true
|
|
timeout-minutes: 10
|
|
|
|
# Upload test artifacts (screenshots, logs)
|
|
- name: Upload test artifacts
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-artifacts
|
|
path: |
|
|
logs/
|
|
cucumber-report.json
|
|
retention-days: 7
|
|
|
|
# Upload application logs
|
|
- name: Upload application logs
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: application-logs
|
|
path: |
|
|
~/.local/share/TidGi/
|
|
userData-dev/logs/
|
|
retention-days: 7
|
|
continue-on-error: true
|