modify: ci.yml #3
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 | ||
run-name: ${{ github.actor }} CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
# Docker already installed in ubuntu-latest runner | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [20.x] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Build and run containers | ||
run: | | ||
docker-compose up --build -d | ||
- name: Run lint | ||
run: docker-compose exec app npm run lint | ||
- name: Run tests | ||
run: docker-compose exec app npm test | ||
- name: Run coverage | ||
run: docker-compose exec app npm run test:cov | ||
- name: Build project | ||
run: docker-compose exec app npm run build | ||
- name: Wait for server to start | ||
run: sleep 10 | ||
- name: Test server | ||
run: curl -f http://localhost:8000 || exit 1 |