Skip to content

test(ui): replace protractor with cypress #121

test(ui): replace protractor with cypress

test(ui): replace protractor with cypress #121

Workflow file for this run

# Runs on pull requests to main when there are changes to the service files in services/
# Lints and Unit tests the services that have changed
name: Service CI
permissions:
contents: read
packages: write
on:
pull_request:
branches: [main]
paths: ["services/**"]
push:
branches: [main]
tags: ["v*"]
paths: ["services/**"]
env:
NODE_VERSION: 22.x
REGISTRY: ghcr.io
jobs:
changes:
runs-on: ubuntu-latest
outputs:
matrix-include: ${{ steps.set-matrix.outputs.filtered }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/filters.yml
- name: Filter service values based on code changes
id: set-matrix
uses: './.github/actions/filter-options'
with:
options: .github/service-values.yml
options-to-select: ${{ steps.filter.outputs.changes }}
lint-and-test:
runs-on: ubuntu-latest
needs: changes
strategy:
matrix:
include: ${{ fromJSON(needs.changes.outputs.matrix-include) }}
defaults:
run:
working-directory: ${{ matrix.context }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ${{ matrix.context }}/package-lock.json
- name: Install NPM Dependencies
run: npm ci --quiet
- name: Lint Code
run: npm run checkstyle:ci
- name: Unit Test
run: npm run test-ci
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ matrix.image }}
tags: |
type=sha
type=ref,event=pr
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}