-.-' #75
Workflow file for this run
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: | |
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: ubuntu-24.04 | |
steps: | |
- name: Set up build and runtime deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl | |
sudo apt-get install -y docker-compose | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run ${{ env.APP_NAME }} with Docker Compose | |
run: | | |
chmod +x run.sh | |
./run.sh | |
- name: Wait for ${{ env.APP_NAME }} to be ready | |
run: | | |
while ! curl -s ${{ env.TEST_ENDPOINT }}; do | |
echo "Waiting for ${{ env.APP_NAME }}..." | |
sleep 1 | |
done | |
- name: Run basic tests | |
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 unit/integration tests | |
run: | | |
npm ci | |
npm run test | |
- name: Report coverage to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./coverage/lcov.info | |
- name: Tear down Docker Compose | |
run: | | |
docker-compose -f docker-compose.yml down |