OPHYK-216 install playwright with deps #5
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: rekisterointi | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
cache-dependency-path: rekisterointi/rekisterointi-ui/package-lock.json | |
- name: Install app dependencies | |
run: npm ci | |
working-directory: rekisterointi/rekisterointi-ui | |
- name: Build react app | |
run: npm run build | |
working-directory: rekisterointi/rekisterointi-ui | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "corretto" | |
cache: "maven" | |
- name: Build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: rekisterointi | |
run: mvn clean package -B -Dbranch=$GITHUB_REF_NAME -Drevision=$GITHUB_SHA -DbuildNumber=$GITHUB_RUN_NUMBER/$GITHUB_RUN_ATTEMPT | |
- name: Upload rekisterointi-jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: rekisterointi-jar | |
path: rekisterointi/target/rekisterointi.jar | |
test: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download rekisterointi-jar | |
uses: actions/download-artifact@v4 | |
with: | |
name: rekisterointi-jar | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
cache-dependency-path: rekisterointi/rekisterointi-ui/package-lock.json | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "corretto" | |
cache: "maven" | |
- name: Install app dependencies | |
run: npm ci | |
working-directory: rekisterointi/rekisterointi-ui | |
- name: Install Playwright dependencies | |
run: npx playwright install --with-deps | |
working-directory: rekisterointi/rekisterointi-ui | |
- name: Run playwright tests | |
run: | | |
docker compose up & | |
cd .. | |
java -jar -Dspring.profiles.active=dev rekisterointi.jar & | |
cd rekisterointi/mock-api | |
npm install | |
npm start & | |
cd ../rekisterointi-ui | |
./scripts/ci-wait-for-frontend.sh | |
HEADLESS=true npm run playwright:test | |
working-directory: rekisterointi | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-results | |
path: rekisterointi/rekisterointi-ui/playwright-results | |
retention-days: 10 |