Add Cypress #31
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| stylelint: | |
| name: Stylelint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Stylelint | |
| run: npx stylelint "**/*.css" | |
| - name: Build Web UI | |
| run: npm run build | |
| prettier: | |
| name: Prettier | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Prettier | |
| run: npx prettier --check "." | |
| - name: Build Web UI | |
| run: npm run build | |
| eslint: | |
| name: ESLint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run ESLint | |
| run: npx eslint . | |
| working-directory: | |
| - name: Build Web UI | |
| run: npm run build | |
| docker-build: | |
| name: Docker Build Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: false | |
| tags: web-ui:test | |
| cypress-dashboard: | |
| name: Cypress - Dashboard | |
| runs-on: ubuntu-latest | |
| needs: docker-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t web-ui:test . | |
| - name: Start container | |
| run: docker run -d -p 3000:80 web-ui:test | |
| - name: Wait for app | |
| run: npx wait-on http://localhost:3000 | |
| - name: Run Cypress | |
| run: npx cypress run --spec "cypress/e2e/dashboard/**/*.cy.ts" | |
| cypress-events: | |
| name: Cypress - Events | |
| runs-on: ubuntu-latest | |
| needs: docker-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t web-ui:test . | |
| - name: Start container | |
| run: docker run -d -p 3000:80 web-ui:test | |
| - name: Wait for app | |
| run: npx wait-on http://localhost:3000 | |
| - name: Run Cypress | |
| run: npx cypress run --spec "cypress/e2e/dashboard/**/*.cy.ts" | |
| cypress-insights: | |
| name: Cypress - Insights | |
| runs-on: ubuntu-latest | |
| needs: docker-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t web-ui:test . | |
| - name: Start container | |
| run: docker run -d -p 3000:80 web-ui:test | |
| - name: Wait for app | |
| run: npx wait-on http://localhost:3000 | |
| - name: Run Cypress | |
| run: npx cypress run --spec "cypress/e2e/dashboard/**/*.cy.ts" | |
| cypress-organizations: | |
| name: Cypress - Organizations | |
| runs-on: ubuntu-latest | |
| needs: docker-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t web-ui:test . | |
| - name: Start container | |
| run: docker run -d -p 3000:80 web-ui:test | |
| - name: Wait for app | |
| run: npx wait-on http://localhost:3000 | |
| - name: Run Cypress | |
| run: npx cypress run --spec "cypress/e2e/dashboard/**/*.cy.ts" | |
| cypress-user: | |
| name: Cypress - User | |
| runs-on: ubuntu-latest | |
| needs: docker-build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t web-ui:test . | |
| - name: Start container | |
| run: docker run -d -p 3000:80 web-ui:test | |
| - name: Wait for app | |
| run: npx wait-on http://localhost:3000 | |
| - name: Run Cypress | |
| run: npx cypress run --spec "cypress/e2e/dashboard/**/*.cy.ts" |