diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c40ac58..edc7cbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,7 +66,7 @@ jobs: - run: | mkdir -p ui/dist/img touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png - - run: docker-compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach + - run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach working-directory: dev - name: Install ArangoDB run: | @@ -94,10 +94,10 @@ jobs: - run: gocap check ./cmd/catalyst cypress: - runs-on: ubuntu-latest strategy: matrix: auth: [ simple, keycloak ] + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -111,34 +111,33 @@ jobs: yarn install yarn serve & working-directory: ui + - run: go install github.com/cugu/wait_for_response@latest - name: Wait for frontend - uses: cugu/wait_for_response@v1.12.0 + uses: cugu/wait_for_response@v1.13.0 with: url: 'http://localhost:8080' responseCode: 200 # run containers - - run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf - shell: bash - - run: sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf - shell: bash - - run: docker-compose up --quiet-pull --detach + - run: | + sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf + sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf + + - run: docker compose up --quiet-pull --detach working-directory: dev - shell: bash - if: ${{ matrix.auth == 'simple' }} - - run: docker-compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach + if: matrix.auth == 'simple' + - run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach working-directory: dev - shell: bash - if: ${{ matrix.auth == 'keycloak' }} + if: matrix.auth == 'keycloak' - name: Wait for keycloak - uses: cugu/wait_for_response@v1.12.0 + uses: cugu/wait_for_response@v1.13.0 with: url: 'http://localhost:9002/auth/realms/catalyst' responseCode: 200 verbose: true timeout: 3m interval: 10s - if: ${{ matrix.auth == 'keycloak' }} + if: matrix.auth == 'keycloak' # run catalyst - run: | @@ -147,12 +146,12 @@ jobs: - run: go mod download - run: bash start_dev.sh & working-directory: dev - if: ${{ matrix.auth == 'simple' }} + if: matrix.auth == 'simple' - run: bash start_dev_with_keycloak.sh & working-directory: dev - if: ${{ matrix.auth == 'keycloak' }} + if: matrix.auth == 'keycloak' - name: Wait for catalyst - uses: cugu/wait_for_response@v1.12.0 + uses: cugu/wait_for_response@v1.13.0 with: url: 'http://localhost:8000' method: GET @@ -162,12 +161,14 @@ jobs: interval: 10s # run cypress - - run: ./node_modules/.bin/cypress run --spec "cypress/integration/catalyst.js" + - uses: cypress-io/github-action@v4 env: CYPRESS_AUTH: ${{ matrix.auth }} - working-directory: ui - + with: + browser: chrome + working-directory: ui - uses: actions/upload-artifact@v3 + if: always() && matrix.auth == 'simple' with: name: cypress-videos path: ui/cypress/videos @@ -225,7 +226,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Version - if: ${{ github.ref != '' }} + if: github.ref != '' run: | echo ${{ github.ref_name }} echo ${{ github.ref_name }} > VERSION diff --git a/dev/docker-compose-with-keycloak.yml b/dev/docker-compose-with-keycloak.yml index 0c42f7f..0cb1f86 100644 --- a/dev/docker-compose-with-keycloak.yml +++ b/dev/docker-compose-with-keycloak.yml @@ -8,7 +8,7 @@ services: networks: [ catalyst ] arangodb: - image: arangodb/arangodb:3.9.1 + image: arangodb/arangodb:3.8.1 environment: ARANGO_ROOT_PASSWORD: foobar networks: [ catalyst ] diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index d3aeaaf..1fbe24f 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -8,7 +8,7 @@ services: networks: [ catalyst ] arangodb: - image: arangodb/arangodb:3.9.1 + image: arangodb/arangodb:3.8.1 environment: ARANGO_ROOT_PASSWORD: foobar networks: [ catalyst ] diff --git a/ui/cypress.config.ts b/ui/cypress.config.ts new file mode 100644 index 0000000..4be4a01 --- /dev/null +++ b/ui/cypress.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'cypress' + +export default defineConfig({ + chromeWebSecurity: false, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents(on, config) { + return require('./cypress/plugins/index.js')(on, config) + }, + baseUrl: 'http://localhost', + experimentalSessionAndOrigin: true, + }, +}) diff --git a/ui/cypress.json b/ui/cypress.json deleted file mode 100644 index 46b1acb..0000000 --- a/ui/cypress.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "baseUrl": "http://localhost", - "chromeWebSecurity": false, - "experimentalSessionAndOrigin": true -} diff --git a/ui/cypress/integration/catalyst.js b/ui/cypress/e2e/catalyst.cy.js similarity index 100% rename from ui/cypress/integration/catalyst.js rename to ui/cypress/e2e/catalyst.cy.js diff --git a/ui/cypress/support/index.js b/ui/cypress/support/e2e.js similarity index 100% rename from ui/cypress/support/index.js rename to ui/cypress/support/e2e.js diff --git a/ui/package.json b/ui/package.json index c53979b..d4c34d7 100644 --- a/ui/package.json +++ b/ui/package.json @@ -70,7 +70,7 @@ "@vue/eslint-config-typescript": "10.0.0", "@vue/test-utils": "2.0.0", "babel-eslint": "10.1.0", - "cypress": "9.7.0", + "cypress": "10.1.0", "eslint": "7.32.0", "eslint-plugin-jest": "26.4.5", "eslint-plugin-vue": "7.20.0", diff --git a/ui/yarn.lock b/ui/yarn.lock index d4be6c4..d8b512f 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -4701,10 +4701,10 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A==" -cypress@9.7.0: - version "9.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-9.7.0.tgz#bf55b2afd481f7a113ef5604aa8b693564b5e744" - integrity sha512-+1EE1nuuuwIt/N1KXRR2iWHU+OiIt7H28jJDyyI4tiUftId/DrXYEwoDa5+kH2pki1zxnA0r6HrUGHV5eLbF5Q== +cypress@10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.1.0.tgz#6514a26c721822a02bc194e9a7f72c3142aea174" + integrity sha512-aQ4JVZVib4Xd9FZW8IRZfKelUvqF4y5A+oUbNvn8TlsBmEfIg3m5Xd6Mt6PVU/jHiVJ9Psl905B3ZPnrDcmyuQ== dependencies: "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4"