You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
2.8 KiB
129 lines
2.8 KiB
name: Auto Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, 1.23.X ]
|
|
paths-ignore:
|
|
- '*.md'
|
|
pull_request:
|
|
branches: [ master, 1.23.X ]
|
|
paths-ignore:
|
|
- '*.md'
|
|
|
|
jobs:
|
|
check-linters:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
- run: npm install
|
|
- run: npm run lint:prod
|
|
|
|
test:
|
|
needs: [ check-linters ]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 15
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest, ARM64]
|
|
node: [ 18, 20 ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Run backend tests
|
|
run: npm run test-backend
|
|
env:
|
|
HEADLESS_TEST: 1
|
|
JUST_FOR_TEST: ${{ secrets.JUST_FOR_TEST }}
|
|
|
|
- name: Run component tests
|
|
run: npm run test-component
|
|
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: test-results-${{ matrix.os }}-node-${{ matrix.node }}
|
|
path: |
|
|
./test-results
|
|
./coverage
|
|
retention-days: 30
|
|
|
|
# As a lot of dev dependencies are not supported on ARMv7, we have to test it separately and just test if `npm ci --production` works
|
|
armv7-simple-test:
|
|
needs: [ ]
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 15
|
|
if: ${{ github.repository == 'louislam/uptime-kuma' }}
|
|
strategy:
|
|
matrix:
|
|
os: [ ARMv7 ]
|
|
node: [ 18, 20 ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js ${{ matrix.node }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
cache: 'npm'
|
|
- run: npm ci --production
|
|
|
|
e2e-test:
|
|
needs: [ check-linters ]
|
|
runs-on: ARM64
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Use Node.js 20
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Install Playwright Browsers
|
|
run: |
|
|
npx playwright install chromium firefox --with-deps
|
|
env:
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0
|
|
PLAYWRIGHT_BROWSERS_PATH: 0
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Run E2E tests
|
|
run: npm run test-e2e
|
|
env:
|
|
HEADLESS_TEST: 1
|
|
|
|
- name: Upload Playwright report
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: playwright-report
|
|
path: ./private/playwright-report
|
|
retention-days: 30
|