CI #407
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: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' # every day at midnight | |
env: | |
COMMON_NAME: example.com | |
ZEEBE_HOSTNAME: test.example.com | |
jobs: | |
build: | |
strategy: | |
matrix: | |
zeebeVersion: [8.1.0, 8.2.2] | |
nodeVersion: | |
- 20 | |
runs-on: ubuntu-latest | |
env: | |
ZEEBE_VERSION: ${{ matrix.zeebeVersion }} | |
NODE_VERSION: ${{ matrix.nodeVersion }} | |
TEST_COUNT: 3 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.nodeVersion }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Setup hosts | |
run: sh -c 'echo "127.0.0.1 $ZEEBE_HOSTNAME"' | sudo tee -a /etc/hosts | |
- name: Generate certificates | |
run: npm run generate-certs | |
- name: Create Zebee container (secure) | |
env: | |
ZEEBE_VERSION: ${{ matrix.zeebeVersion }} | |
run: docker-compose up --no-start zeebe | |
- name: Start Zebee (secure) | |
run: docker-compose up --detach zeebe | |
- name: Sleep for 10 seconds | |
run: sleep 10s | |
- name: Test (secure) | |
env: | |
ZEEBE_ADDRESS: test.example.com:26500 | |
run: | | |
npm run test:secure | tee output.txt | |
results=$(grep -E "\"gatewayVersion\":\s*\"${ZEEBE_VERSION}\"" -c output.txt) | |
if [[ "$results" != "$TEST_COUNT" ]]; then | |
echo "missing <gatewayVersion>" | |
exit 1 | |
fi | |
- name: Stop Zeebe (secure) | |
run: docker-compose down | |
- name: Create Zebee container (insecure) + reverse proxy | |
env: | |
ZEEBE_VERSION: ${{ matrix.zeebeVersion }} | |
run: docker-compose --env-file ./.env.proxy up --no-start zeebe proxy | |
- name: Start Zebee (insecure) + reverse proxy | |
run: docker-compose --env-file ./.env.proxy up --detach zeebe proxy | |
- name: Sleep for 10 seconds | |
run: sleep 10s | |
- name: Test (secure) | |
env: | |
ZEEBE_ADDRESS: test.example.com:443 | |
run: | | |
npm run test:secure | tee output.txt | |
results=$(grep -E "\"gatewayVersion\":\s*\"${ZEEBE_VERSION}\"" -c output.txt) | |
if [[ "$results" != "$TEST_COUNT" ]]; then | |
echo "missing <gatewayVersion>" | |
exit 1 | |
fi | |
- name: Stop Zebee (insecure) + reverse proxy | |
run: docker-compose down | |
- name: Create Zeebe container (insecure) | |
run: docker-compose --env-file ./.env.insecure up --no-start zeebe | |
- name: Start Zebee (insecure) | |
run: docker-compose --env-file ./.env.insecure up --detach zeebe | |
- name: Sleep for 10 seconds | |
run: sleep 10s | |
- name: Test (insecure) | |
env: | |
ZEEBE_ADDRESS: test.example.com:26500 | |
run: | | |
npm run test:insecure | tee output.txt | |
results=$(grep -E "\"gatewayVersion\":\s*\"${ZEEBE_VERSION}\"" -c output.txt) | |
if [[ "$results" != "$TEST_COUNT" ]]; then | |
echo "missing <gatewayVersion>" | |
exit 1 | |
fi | |
- name: Stop Zeebe (insecure) | |
run: docker-compose down |