Setup node in ci and install cypress dependency #3
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
on: push | |
jobs: | |
run-e2e: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'oracle' | |
- name: Set up node 18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.17.1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build JAR with mvn package | |
run: mvn clean package | |
- name: Build the docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: Dockerfile | |
tags: uni-luzern:latest | |
load: true | |
push: false | |
outputs: type=docker,dest=/tmp/okr-docker-image.tar | |
- name: Load image | |
run: docker load --input /tmp/okr-docker-image.tar | |
- name: Run docker image | |
run: docker run --rm -v ./static:/resources -p 8080:8080 uni-luzern:latest & | |
- name: Cypress run e2e tests | |
uses: cypress-io/github-action@v6 | |
with: | |
build: npm i -D cypress | |
install: false | |
wait-on: 'http://localhost:8080/' | |
wait-on-timeout: 120 | |
browser: chrome | |
headed: true | |
working-directory: src/test/e2e | |
config: baseUrl=http://localhost:8080 |