Add 29 April ClawBio workshop and pharmacogenomics tutorial #66
This file contains hidden or 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: E2E Tests (Playwright) | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| branches: ["main"] | |
| # Cancel in-progress runs for the same branch when a newer commit is pushed. | |
| concurrency: | |
| group: e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e: | |
| name: Playwright tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| # ----------------------------------------------------------------------- | |
| # 1. Source code | |
| # ----------------------------------------------------------------------- | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # ----------------------------------------------------------------------- | |
| # 2. Ruby + Jekyll — build the site to _site/ | |
| # ----------------------------------------------------------------------- | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true # runs `bundle install` and caches gems | |
| - name: Build Jekyll site | |
| run: bundle exec jekyll build --destination _site | |
| env: | |
| JEKYLL_ENV: production | |
| # ----------------------------------------------------------------------- | |
| # 3. Node.js + Playwright | |
| # ----------------------------------------------------------------------- | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: e2e/package.json | |
| - name: Install e2e dependencies | |
| working-directory: e2e | |
| run: npm install | |
| - name: Install Playwright browsers | |
| working-directory: e2e | |
| run: npx playwright install --with-deps chromium webkit | |
| # ----------------------------------------------------------------------- | |
| # 4. Serve the pre-built site and run tests | |
| # ----------------------------------------------------------------------- | |
| - name: Serve pre-built site | |
| # npx serve runs in the background; we wait for it to be ready with a | |
| # lightweight check inside the Playwright config (BASE_URL env var). | |
| run: | | |
| npx serve ../_site -l 4000 & | |
| # Give the server a moment to start before tests begin. | |
| sleep 3 | |
| working-directory: e2e | |
| - name: Run Playwright tests | |
| working-directory: e2e | |
| run: npx playwright test | |
| env: | |
| BASE_URL: http://localhost:4000 | |
| CI: "true" | |
| # ----------------------------------------------------------------------- | |
| # 5. Artifacts | |
| # ----------------------------------------------------------------------- | |
| - name: Upload Playwright HTML report | |
| if: always() # upload even on test failure | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report/ | |
| retention-days: 14 |