Skip to content

Cleanup workflows

Cleanup workflows #492

Workflow file for this run

---
name: Integration
on:
push:
pull_request:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
jobs:
pre:
# Verification to be done before the real check
name: Pre-check
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_flag.outputs.should_skip }}
steps:
- name: Skip flag
id: skip_flag
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: "same_content_newer"
paths: '["docker-compose.yml", "client/**", "client-e2e/**", ".github/workflows/integrate.yml"]'
build:
name: Build/Test
needs: pre
if: needs.pre.outputs.should_skip != 'true'
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Prepare environment
run: |
IP=$(ip address show eth0 | grep inet | cut -d ' ' -f 6 | cut -d '/' -f1 | head -n1)
printf "HOST_IP address is: %s\n" "$IP"
cat <<EOF >> ./.env
HOST_IP="$IP"
EOF
cat <<EOF >> ./client/.env
NODE_ENV=development
MAILBOX_URL="wss://mailbox.stage.mw.winden.app/v1"
RELAY_URL="wss://relay.stage.mw.windent.app"
EOF
printf "Client .env:\n"
cat ./client/.env
printf "Client-e2e .env:\n"
cat ./.env
- name: Prepare containers
run: |
docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile e2e build --build-arg uid="$(id -u)" --build-arg gid="$(id -g)"
docker compose run --rm client npm i
docker compose run --rm client ./scripts/setup.sh
docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile e2e run --rm client-e2e npm i
- name: Start devserver
run: |
docker compose up -d client
docker compose exec client ./scripts/wait-for-webpack.sh
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run UNIT and INTEGRATION tests
run: docker compose run --rm client npm run test -- --coverage
- name: Run END-2-END tests
run: |
docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile e2e run --rm client-e2e
- name: Stop the containers
run: docker compose -f docker-compose.yml -f docker-compose.e2e.yml --profile e2e down
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}