fix: update README to inculde validate CI pipeline status #16
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: Unit Tests | |
env: | |
ENVIRONMENT: test | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [master] | |
jobs: | |
unittest: | |
runs-on: ubuntu-latest | |
environment: ${{ vars.ENVIRONMENT }} | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: ${{ vars.DATABASE }} | |
POSTGRES_USER: ${{ vars.DBUSER }} | |
POSTGRES_PASSWORD: ${{ secrets.DBPASSWORD }} | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
name: Run unit tests | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: "Create .env file" | |
run: | | |
touch .env | |
echo ENVIRONMENT=${{ env.ENVIRONMENT }} >> .env | |
echo HOSTNAME=${{ secrets.HOSTNAME}} >> .env | |
echo PORT=${{ secrets.PORT }} >> .env | |
echo DATABASE=${{ vars.DATABASE }} >> .env | |
echo DBUSER=${{ vars.DBUSER }} >> .env | |
echo DBPASSWORD=${{ secrets.DBPASSWORD }} >> .env | |
- name: Clean Install Dependencies | |
run: npm ci | |
- name: Run test scripts | |
run: npm run test | |
# Github token to run public workflows | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |