CI #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: .tests | |
shell: bash | |
jobs: | |
test: | |
timeout-minutes: 180 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Define env name | |
id: define-environment-name | |
run: | | |
echo "env-name=ci-$(date +%s%N)" >> $GITHUB_OUTPUT | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright browsers | |
run: | | |
npx playwright install --with-deps | |
- name: Find all Jupyter notebooks | |
run: find .. -name '*.ipynb' > ./files.txt | |
- name: Set CSAE_WORKERS_COUNT env variable | |
run: export CPU_CORES=$(nproc) | |
- name: Start test environments | |
id: start-test-environment | |
run: npx ts-node pre_create_env.ts | |
env: | |
CSAE_ENV_PASSWORD: '${{ secrets.CSAE_ENV_PASSWORD }}' | |
CSAE_CLEARSCAPE_API_KEY: '${{ secrets.CSAE_CLEARSCAPE_API_KEY }}' | |
CSAE_PARALLEL_TESTS_COUNT: '${{ secrets.CSAE_PARALLEL_TESTS_COUNT }}' | |
- name: Run Playwright tests | |
run: | | |
npx playwright test | |
env: | |
CSAE_ENV_PASSWORD: '${{ secrets.CSAE_ENV_PASSWORD }}' | |
CSAE_CLEARSCAPE_API_KEY: '${{ secrets.CSAE_CLEARSCAPE_API_KEY }}' | |
CSAE_PARALLEL_TESTS_COUNT: '${{ secrets.CSAE_PARALLEL_TESTS_COUNT }}' | |
- name: Delete test environments | |
if: always() | |
run: npx ts-node post_delete_env | |
env: | |
CSAE_ENV_PASSWORD: '${{ secrets.CSAE_ENV_PASSWORD }}' | |
CSAE_CLEARSCAPE_API_KEY: '${{ secrets.CSAE_CLEARSCAPE_API_KEY }}' | |
CSAE_PARALLEL_TESTS_COUNT: '${{ secrets.CSAE_PARALLEL_TESTS_COUNT }}' | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: .tests/playwright-report/ | |
retention-days: 30 |