Skip to content

1.0.3 Changes

1.0.3 Changes #202

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
container-job:
runs-on: ubuntu-latest
container:
image: node:16
services:
postgres:
image: severinoo/postgis-c:12-3.3
env:
POSTGRES_DB: sikka-buya-test
POSTGRES_PASSWORD: ${{secrets.POSTGRES_SUPER_PASSWORD}}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
#### System Setup
####
# Setup System Locale
- name: Setup locale
run: |
echo "Current System Locale: "
locale
- name: Update Packages
run: apt update
- name: Install Firefox and Cypress Dependencies
run: apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
## Install Node
#- name: Use Node.js 16
# uses: actions/setup-node@v3
# with:
# node-version: 16
# cache: 'npm'
#### Directory Setup
- name: Checkout
uses: actions/checkout@v3
- run: npm install grunt -g
- run: yarn install --frozen-lockfile
- name: "Create .env File"
working-directory: ./test
run: |
touch .env
echo "${{secrets.ENV_FILE}}" >> .env
cat .env
# API Tests
- run: npm run test:api
working-directory: ./test
env:
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
DB_HOST: postgres
DB_SUPER_NAME: sikka-buya-test
DB_READ_ONLY_PASSWORD: ${{secrets.POSTGRES_READ_ONLY_PASSWORD}}
DB_SUPER_PASSWORD: ${{secrets.POSTGRES_SUPER_PASSWORD}}
DB_PASSWORD: ${{secrets.POSTGRES_SUPER_PASSWORD}}
DB_PORT: 5432 # get randomly assigned published port
# Cypress
- name: Cypress Run
run: npm run cypress:run
working-directory: ./test
env:
# use postgres for the host here because we have specified a container for the job.
# If we were running the job on the VM this would be localhost
DB_HOST: postgres
DB_SUPER_NAME: sikka-buya-test
DB_READ_ONLY_PASSWORD: ${{secrets.POSTGRES_READ_ONLY_PASSWORD}}
DB_SUPER_PASSWORD: ${{secrets.POSTGRES_SUPER_PASSWORD}}
DB_PASSWORD: ${{secrets.POSTGRES_SUPER_PASSWORD}}
DB_PORT: 5432 # get randomly assigned published port