Skip to content

feat(Identifier types): Identifier Types Page and Identifier Types Editor #1129

feat(Identifier types): Identifier Types Page and Identifier Types Editor

feat(Identifier types): Identifier Types Page and Identifier Types Editor #1129

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
# Triggers the workflow on pull request events in the context of the fork
# trying to sidestep limitations here: https://github.com/wearerequired/lint-action/issues/13
pull_request:
jobs:
build-test:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:12.3
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bookbrainz_test
# Since we run npm tests on the host machine (not in a docker container)
# we need to bind the Postgres port from Docker container to host machine
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install PostgreSQL client
run: |
sudo apt-get update
sudo apt-get install --yes postgresql-client
#Set up ElasticSearch
- name: Run Elasticsearch
# Replace this with official elastic-github-actions/elasticsearch once they are ready for prod
uses: getong/[email protected]
with:
elasticsearch version: '5.6.8'
host port: 9200
container port: 9200
host node port: 9300
node port: 9300
discovery type: 'single-node'
- name: Checkout code
uses: actions/checkout@v2
# Set up the test dabatase
- name: Set up test database in PostgreSQL
run: ./scripts/create-test-db.sh
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: bookbrainz_test
POSTGRES_HOST: localhost
- name: Set up node
uses: actions/setup-node@v1
with:
# We could also test on multiple Node versions if needed: https://github.com/actions/setup-node#matrix-testing
node-version: '16'
# Enables caching NPM dependencies (uses https://github.com/actions/cache under the hood)
cache: 'yarn'
# Performs a clean installation of all dependencies in the `package.json` file
# For more information, see https://docs.npmjs.com/cli/ci.html
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: yarn run test-ci # run tests (configured to use mocha's json reporter)
- name: Export test results
uses: actions/upload-artifact@v2 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: test-results.json