mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
parent
9d667f9b15
commit
060cc5bfb5
1 changed files with 30 additions and 61 deletions
91
.github/workflows/auto-test.yml
vendored
91
.github/workflows/auto-test.yml
vendored
|
@ -1,3 +1,6 @@
|
||||||
|
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||||
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||||
|
|
||||||
name: Auto Test
|
name: Auto Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
@ -11,19 +14,7 @@ on:
|
||||||
- '*.md'
|
- '*.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-linters:
|
auto-test:
|
||||||
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 ]
|
needs: [ check-linters ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
@ -32,41 +23,23 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, ubuntu-latest, windows-latest, ARM64]
|
os: [macos-latest, ubuntu-latest, windows-latest, ARM64]
|
||||||
node: [ 18, 20 ]
|
node: [ 18, 20 ]
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- run: git config --global core.autocrlf false # Mainly for Windows
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node }}
|
- name: Use Node.js ${{ matrix.node }}
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
cache: 'npm'
|
- run: npm install
|
||||||
|
- run: npm run build
|
||||||
- name: Install dependencies
|
- run: npm run test-backend
|
||||||
run: npm install
|
|
||||||
|
|
||||||
- name: Build project
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Run backend tests
|
|
||||||
run: npm run test-backend
|
|
||||||
env:
|
env:
|
||||||
HEADLESS_TEST: 1
|
HEADLESS_TEST: 1
|
||||||
JUST_FOR_TEST: ${{ secrets.JUST_FOR_TEST }}
|
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
|
# 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:
|
armv7-simple-test:
|
||||||
needs: [ ]
|
needs: [ ]
|
||||||
|
@ -77,48 +50,44 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ARMv7 ]
|
os: [ ARMv7 ]
|
||||||
node: [ 18, 20 ]
|
node: [ 18, 20 ]
|
||||||
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- run: git config --global core.autocrlf false # Mainly for Windows
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use Node.js ${{ matrix.node }}
|
- name: Use Node.js ${{ matrix.node }}
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
cache: 'npm'
|
|
||||||
- run: npm ci --production
|
- run: npm ci --production
|
||||||
|
|
||||||
e2e-test:
|
check-linters:
|
||||||
needs: [ check-linters ]
|
runs-on: ubuntu-latest
|
||||||
runs-on: ARM64
|
|
||||||
timeout-minutes: 30
|
|
||||||
steps:
|
steps:
|
||||||
|
- run: git config --global core.autocrlf false # Mainly for Windows
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Use Node.js 20
|
- name: Use Node.js 20
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'npm'
|
- run: npm install
|
||||||
|
- run: npm run lint:prod
|
||||||
|
|
||||||
- name: Install dependencies
|
e2e-test:
|
||||||
run: npm install
|
needs: [ ]
|
||||||
|
runs-on: ARM64
|
||||||
|
steps:
|
||||||
|
- run: git config --global core.autocrlf false # Mainly for Windows
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Playwright browsers
|
- name: Use Node.js 20
|
||||||
run: npx playwright install --with-deps chromium firefox
|
uses: actions/setup-node@v4
|
||||||
|
|
||||||
- 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:
|
with:
|
||||||
name: playwright-report
|
node-version: 20
|
||||||
path: ./private/playwright-report
|
- run: npm install
|
||||||
retention-days: 30
|
- run: npx playwright install
|
||||||
|
- run: npm run build
|
||||||
|
- run: npm run test-e2e
|
||||||
|
|
Loading…
Reference in a new issue