a0m0rajab is testing out GitHub Actions π #37
Workflow file for this run
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: Playwright Tests | |
run-name: ${{ github.actor }} is testing out GitHub Actions π | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: self-hosted | |
environment: upwithcrowd | |
env: | |
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
TEST_USERNAME: ${{ secrets.TEST_USERNAME }} | |
AUTH_TRUST_HOST: ${{ secrets.TRUST_HOST }} | |
AUTH_SECRET: ${{ secrets.AUTH_SECRET }} | |
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | |
APPLICATION_NAME: ${{ vars.APPLICATION_NAME }} | |
BASE_URL: ${{ secrets.BASE_URL }} | |
PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }} | |
steps: | |
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "π The secret user is ${{ secrets.TEST_USERNAME }}" | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2.0.3 | |
with: | |
directory: "apps/web" | |
file_name: .env | |
fail_on_empty: true | |
sort_keys: false | |
envkey_TEST_USERNAME: ${{ secrets.TEST_USERNAME }} | |
envkey_APPLICATION_NAME: ${{ vars.APPLICATION_NAME }} | |
envkey_PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }} | |
- name: show .env file | |
run: | | |
cd .\apps\web | |
cat .env | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: | | |
npm install -g pnpm | |
pnpm install | |
- name: Install Playwright Browsers | |
run: pnpm exec playwright install --with-deps | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2.0.3 | |
with: | |
directory: "apps/web" | |
file_name: .env | |
fail_on_empty: true | |
sort_keys: false | |
envkey_TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }} | |
envkey_TEST_USERNAME: ${{ secrets.TEST_USERNAME }} | |
envkey_AUTH_TRUST_HOST: ${{ secrets.TRUST_HOST }} | |
envkey_AUTH_SECRET: ${{ secrets.AUTH_SECRET }} | |
envkey_NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} | |
envkey_APPLICATION_NAME: ${{ vars.APPLICATION_NAME }} | |
envkey_BASE_URL: ${{ secrets.BASE_URL }} | |
envkey_PRIMARY_COLOR: ${{ vars.PRIMARY_COLOR }} | |
- name: build web app | |
run: pnpm run build:web | |
- name: start web app | |
run: pnpm run start:web ("&") npx wait-on http://127.0.0.1:3000 | |
- name: Run Playwright tests | |
run: pnpm exec playwright test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 |