tethys.backend/.gitea/workflows/ci.yaml

72 lines
2.6 KiB
YAML
Raw Normal View History

2023-05-09 12:43:16 +00:00
# This workflow will do a clean install of node dependencies, build the source code and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI Pipeline
run-name: ${{ github.actor }} is running CI pipeline
# trigger build when pushing, or when creating a pull request
on: [push, pull_request]
jobs:
japa-tests:
# run build on latest ubuntu
2023-05-09 12:52:42 +00:00
runs-on: ubuntu-latest
2023-05-09 13:08:40 +00:00
services:
2023-05-09 12:57:48 +00:00
postgres:
image: postgres
env:
2023-05-09 13:08:40 +00:00
POSTGRES_USER: ProjectName
POSTGRES_PASSWORD: password
POSTGRES_DB: ProjectName-test
2023-05-09 12:57:48 +00:00
# Set health checks to wait until postgres has started
options: >-
2023-05-09 13:08:40 +00:00
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
2023-05-09 12:43:16 +00:00
steps:
# this will check out the current branch (https://github.com/actions/checkout#Push-a-commit-using-the-built-in-token)
- name: Check out repository code
uses: actions/checkout@v3
# installing Node
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
# this will use the latest Node 12 version
node-version: 16.x
# install dependencies using clean install to avoid package lock updates
# build the project if necessary
# - run: npm run build
# - run: cd build
- name: Install dependencies
run: npm ci
# - run: npm ci --omit=dev
# finally run the tests
# - run: npm test
- name: Run tests
run: node ace test
2023-05-09 12:52:42 +00:00
env:
2023-05-09 12:57:48 +00:00
DB_CONNECTION: pg
PG_HOST: postgres
PG_PORT: 5432
PG_USER: ProjectName
PG_PASSWORD: password
PG_DB_NAME: ProjectName-test
2023-05-09 12:52:42 +00:00
PORT: 3333
2023-05-09 13:08:40 +00:00
HOST: 0.0.0.0
2023-05-09 12:52:42 +00:00
APP_KEY: somefakekeythatis>16characters
NODE_ENV: test
ASSETS_DRIVER: fake
SESSION_DRIVER: memory
CACHE_VIEWS: false
DRIVE_DISK: local
2023-05-09 12:43:16 +00:00
# # Save coverage report in Coveralls
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}