Files
puter/.github/workflows/test.yml
T
Daniel Salazar cea94d16cb
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test-backend (20.x) (push) Has been cancelled
test / test-backend (22.x) (push) Has been cancelled
test / backend (node env, api-test) (22.x) (push) Has been cancelled
test / puterjs (browser env, playwright) (22.x) (push) Has been cancelled
test / puterjs (node env, vitest) (22.x) (push) Has been cancelled
fix: backend tests breaking with permision (#2067)
2025-11-29 13:50:27 -08:00

152 lines
3.7 KiB
YAML

name: test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test-backend:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.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
run: |
rm package-lock.json
npm install -g npm@latest
npm install
npm run build
npm run test:backend
api-test:
name: backend (node env, api-test)
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
node-version: [22.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
playwright-test:
if: false
name: puterjs (browser env, playwright)
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [22.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: Install Dependencies
run: npm install
working-directory: ./tests/playwright
- name: Install Playwright Browsers
run: npx playwright install --with-deps
working-directory: ./tests/playwright
- name: Playwright Test
run: |
pip install -r ./tests/ci/requirements.txt
./tests/ci/playwright-test.py
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: (playwright) server-logs
path: |
/tmp/backend.log
/tmp/fs-tree-manager.log
retention-days: 3
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: (playwright) config-files
path: |
./volatile/config/config.json
./src/fs_tree_manager/config.yaml
./tests/client-config.yaml
retention-days: 3
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
id: playwright-report
with:
name: (playwright) playwright-report
path: tests/playwright/playwright-report/
retention-days: 3
- name: Get Playwright artifact URL
run: |
ARTIFACT_URL=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \
--jq '.artifacts[] | select(.name=="playwright-report") | .archive_download_url')
echo "url=$ARTIFACT_URL" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Output artifact URL
run: echo 'Artifact URL is ${{ steps.playwright-report.outputs.artifact-url }}'
vitest:
name: puterjs (node env, vitest)
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
matrix:
node-version: [22.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