chore: import keycloak-js #297
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: Lagoon UI CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
- cypress-test | |
jobs: | |
format-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: yarn | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Formatting check | |
run: | | |
yarn add [email protected] @trivago/prettier-plugin-sort-imports | |
yarn format-check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Linting | |
run: | | |
yarn add [email protected] | |
yarn lint | |
cypress-tests: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
fail-fast: false | |
matrix: | |
lagoon_image_tag: ["main"] | |
lagoon_image_repo: ["testlagoon"] | |
experimental: [false] | |
# include: | |
# - lagoon_image_tag: "v2.20.1" | |
# lagoon_image_repo: "uselagoon" | |
# experimental: true | |
# needs: [format-check, lint] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Build and start Lagoon-minimal | |
run: | | |
make development-api LAGOON_CORE_IMAGE_REPO=${{matrix.lagoon_image_repo}} LAGOON_CORE_IMAGE_TAG=${{matrix.lagoon_image_tag}} | |
- name: Start ui | |
env: | |
GRAPHQL_API: http://localhost:3000/graphql | |
KEYCLOAK_API: http://localhost:8088/auth | |
NODE_PORT: 3003 | |
run: | | |
yarn install | |
yarn build | |
yarn start & | |
- name: Run RBAC Cypress Tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config-file: ./cypress/cypress.config.ts | |
auto-cancel-after-failures: 1 | |
wait-on: 'http://localhost:3003' | |
command: yarn cypress:runRbac | |
env: | |
cypress_api: http://localhost:3000/graphql | |
cypress_keycloak: http://localhost:8088/auth | |
cypress_url: http://localhost:3003 | |
- name: Run Organization Cypress Tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config-file: ./cypress/cypress.config.ts | |
auto-cancel-after-failures: 1 | |
wait-on: 'http://localhost:3003' | |
command: yarn cypress:runOrganizations | |
env: | |
cypress_api: http://localhost:3000/graphql | |
cypress_keycloak: http://localhost:8088/auth | |
cypress_url: http://localhost:3003 | |
- name: Run General Cypress Tests | |
uses: cypress-io/github-action@v6 | |
with: | |
config-file: ./cypress/cypress.config.ts | |
auto-cancel-after-failures: 1 | |
wait-on: 'http://localhost:3003' | |
command: yarn cypress:runGeneral | |
env: | |
cypress_api: http://localhost:3000/graphql | |
cypress_keycloak: http://localhost:8088/auth | |
cypress_url: http://localhost:3003 | |
- name: Export API logs on failure | |
if: failure() | |
run: | | |
docker compose -p core-lagoon-ui logs api | |
- name: Save screenshots on failure | |
uses: actions/upload-artifact@v4 | |
# add the line below to store screenshots only on failures | |
if: failure() | |
with: | |
name: cypress-screenshots | |
path: cypress/screenshots | |
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | |
- name: Save videos on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: cypress-videos | |
path: cypress/videos | |
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` | |
- name: Stop Docker containers | |
run: | | |
make development-api-down |