Files
myeasycms-v2/.github/workflows/workflow.yml
giancarlo e517d18d48 Update GitHub Actions workflow
Enhancements have been made to the GitHub Actions workflow. The fetch depth has been updated and a cache has been added. Node.js dependencies are now setup with 'pnpm' cache and the 'test' timeout minutes have been reduced to 15. Also, Playwright Browsers are now installed before running Playwright tests.
2024-04-11 16:21:08 +08:00

66 lines
1.5 KiB
YAML

name: Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Typecheck
run: pnpm run typecheck
- name: Lint
run: pnpm run lint
test:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'pnpm'
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec ./apps/e2e/node_modules/.bin/playwright install --with-deps
- name: Run Playwright tests
run: pnpm run test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30