name: test on: push: branches: ["main"] paths-ignore: - "src/docs/**" pull_request: branches: ["main"] paths-ignore: - "src/docs/**" jobs: test-backend: runs-on: ubuntu-latest strategy: matrix: node-version: [24.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Backend Tests (with coverage) env: NODE_OPTIONS: "--max-old-space-size=4096" run: | npm ci npm run build npm run test:backend -- --coverage --coverage.reporter=json --coverage.reporter=json-summary --coverage.reporter=lcov - name: Upload backend coverage report if: ${{ always() && hashFiles('coverage/**/coverage-summary.json') != '' }} uses: actions/upload-artifact@v4 with: name: backend-coverage-${{ matrix.node-version }} path: coverage retention-days: 5 api-test: name: API tests (node env, api-test) runs-on: ubuntu-latest timeout-minutes: 10 strategy: matrix: node-version: [24.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: API Test run: | pip install -r ./tests/ci/requirements.txt ./tests/ci/api-test.py - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: name: (api-test) server-logs path: /tmp/backend.log retention-days: 3 vitest: name: puterjs (node env, vitest) runs-on: ubuntu-latest timeout-minutes: 10 strategy: matrix: node-version: [24.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Vitest Test run: | pip install -r ./tests/ci/requirements.txt ./tests/ci/vitest.py