test: valideer volgorde bewoners en mogelijke bewoners #80
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: continuous integration | |
on: | |
push: | |
paths: | |
- src/** | |
- features/** | |
- .github/workflows/ci.yml | |
workflow_dispatch: | |
inputs: | |
publishType: | |
description: wat moet worden gereleased? | |
required: true | |
default: 'ci-only' | |
type: choice | |
options: | |
- ci-only | |
- app | |
env: | |
NODE_VERSION: '20' | |
DOTNET_SOLUTION_FILE_PATH: src/BewoningDataService.sln | |
APP_PROJECT_PATH: ./src/Bewoning.Data.Service | |
APP_CSPROJ_FILE_PATH: ./src/Bewoning.Data.Service/Bewoning.Data.Service.csproj | |
APP_CONTAINER_IMAGE: ghcr.io/brp-api/bewoning-data-service | |
jobs: | |
continuous-integration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Genereer build run identifier | |
id: build-run-id | |
uses: ./.github/actions/genereer-build-run-identifier | |
- name: Zet versie met build run in App csproj | |
uses: ./.github/actions/zet-versie-met-build-run-in-csproj | |
id: app-version | |
with: | |
path-csproj-file: ${{ env.APP_CSPROJ_FILE_PATH }} | |
build-run: ${{ steps.build-run-id.outputs.build-run }} | |
- name: Bepaal de gewijzigde applicatie(s) | |
uses: dorny/paths-filter@v3 | |
id: changed-project | |
with: | |
filters: | | |
app: | |
- '${{ env.APP_PROJECT_PATH }}/**' | |
- name: Valideer .NET solution | |
uses: ./.github/actions/valideer-dotnet-solution | |
with: | |
path-solution-file: ${{ env.DOTNET_SOLUTION_FILE_PATH }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Zet run permissions op script folder | |
uses: ./.github/actions/zet-run-bash-scripts-permission | |
with: | |
path-bash-file-or-folder: ./scripts/* | |
- name: Build container images | |
run: | | |
./scripts/containers-build.sh | |
- name: Start containers | |
run: | | |
./scripts/containers-start.sh ci | |
- name: Wait for DB restart | |
run: sleep 5s | |
shell: bash | |
- name: Run unit tests | |
run: | | |
./scripts/unit-tests-verify.sh | |
- name: Valideer functionele specs | |
run: | | |
./scripts/specs-verify.sh | |
- name: Voeg test summary toe aan Github Step Summary | |
if: always() | |
run: | | |
echo "### Cucumber Test Reports" >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
cat test-reports/cucumber-js/bewoning/test-result-summary.txt >> $GITHUB_STEP_SUMMARY | |
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | |
- name: Stop containers | |
if: always() | |
run: | | |
./scripts/containers-stop.sh ci | |
- name: Genereer test rapportage | |
if: always() | |
run: | | |
node ./scripts/generate-cucumber-reports.js ${{ steps.app-version.outputs.version }} ${{ steps.build-run-id.outputs.build-run }} ${{ github.ref_name }} | |
- name: Upload test rapportage | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Reports | |
path: | | |
test-reports | |
test-data/logs | |
- name: Push test rapportage naar brp-api.github.io repo | |
if: always() | |
uses: tech-thinker/push-to-repo@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.GIT_PAT_TOKEN }} | |
with: | |
source-directory: test-reports/cucumber-js/reports | |
destination-repository-name: brp-api.github.io | |
destination-github-username: BRP-API | |
target-branch: test-reports/bewoning | |
commit-message: "test rapporten van build: ${{ steps.build-run-id.outputs.build-run }}" | |
- name: Login to GitHub Container Registry | |
if: always() | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configureer container image builder voor multi-platform | |
if: always() | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
driver: docker-container | |
- name: Build & push bewoning data service container images naar registry | |
if: always() && (steps.changed-project.outputs.app == 'true' || inputs.publishType == 'app') | |
uses: docker/build-push-action@v6 | |
with: | |
file: ${{ env.APP_PROJECT_PATH }}/Dockerfile | |
context: src | |
push: true | |
platforms: linux/arm64,linux/amd64 | |
tags: | | |
${{ env.APP_CONTAINER_IMAGE }}:latest | |
${{ env.APP_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-latest | |
${{ env.APP_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-${{ steps.build-run-id.outputs.build-run }} | |
${{ env.APP_CONTAINER_IMAGE }}:${{ github.sha }} |