improve workflow

pull/5364/head
Zaid-maker 1 week ago
parent 4f1fe96275
commit a3358e2983

@ -1,6 +1,3 @@
# 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:
@ -14,7 +11,19 @@ on:
- '*.md' - '*.md'
jobs: jobs:
auto-test: 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 ] needs: [ check-linters ]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 15 timeout-minutes: 15
@ -23,23 +32,41 @@ 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 }}
- run: npm install cache: 'npm'
- run: npm run build
- run: npm run test-backend - name: Install dependencies
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: [ ]
@ -50,44 +77,48 @@ 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
check-linters: e2e-test:
runs-on: ubuntu-latest needs: [ check-linters ]
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
- run: npm install cache: 'npm'
- run: npm run lint:prod
e2e-test: - name: Install dependencies
needs: [ ] run: npm install
runs-on: ARM64
steps:
- run: git config --global core.autocrlf false # Mainly for Windows
- uses: actions/checkout@v4
- name: Use Node.js 20 - name: Install Playwright browsers
uses: actions/setup-node@v4 run: npx playwright install --with-deps chromium firefox
- 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:
node-version: 20 name: playwright-report
- run: npm install path: ./private/playwright-report
- run: npx playwright install retention-days: 30
- run: npm run build
- run: npm run test-e2e

Loading…
Cancel
Save