Skip to content

Remove macOS from workflow matrix #92

Remove macOS from workflow matrix

Remove macOS from workflow matrix #92

Workflow file for this run

name: CI
on:
push:
pull_request:
branches:
- main
paths:
- '.github/workflows/ci.yml'
- 'src/**'
- 'run.sh'
env:
APP_NAME: ${{ vars.APP_NAME }}
TEST_ENDPOINT: 'http://localhost:${{ vars.APP_HOST_PORT }}${{ vars.TEST_ROUTE }}'
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run ${{ env.APP_NAME }} with Docker Compose (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
chmod +x run.sh
./run.sh
- name: Run ${{ env.APP_NAME }} with Docker Compose (Windows)
if: matrix.os == 'windows-latest'
run: |
.\run.ps1
- name: Run basic test (workshop scenario, Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" ${{ env.TEST_ENDPOINT }})
if [ $RESPONSE_CODE -eq 200 ]; then
echo "Basic health check PASSED!"
else
echo " Basic health check FAILED!"
exit 1
fi
- name: Run basic test (workshop scenario, Windows)
if: matrix.os == 'windows-latest'
run: |
$RESPONSE_CODE = (Invoke-WebRequest -Uri ${{ env.TEST_ENDPOINT }}).StatusCode
if ($RESPONSE_CODE -eq 200) {
Write-Output "Basic health check PASSED!"
} else {
Write-Output "Basic health check FAILED!"
exit 1
}
- name: Tear down Docker Compose
run: |
docker-compose -f docker-compose.yml down
- name: Run unit/integration tests
run: |
npm ci
npm run test
- name: Report coverage to Coveralls
if: matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info