Bump typeorm from 0.2.45 to 0.3.0 #317
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
PACT_BROKER_BASE_URL: https://c4cneu.pactflow.io | |
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN }} | |
PACT_PACTICIPANT: jpal-backend | |
GIT_COMMIT: ${{ github.sha }} | |
GITHUB_REF: ${{ github.ref }} | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
# Postgres service for E2E testing | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DATABASE: postgres | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
JWT_SECRET: test_secret_for_CI | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
# We are using Node.js 14 because it is the current LTS version | |
node-version: 14.x | |
- uses: mansona/npm-lockfile-version@v1 | |
- run: npm ci | |
- run: npm run check | |
- run: npm run test | |
- run: npm run build | |
- run: npm run typeorm migration:run | |
- run: npm run test:e2e | |
- run: npm run test:pact | |
can-i-deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v2 | |
- run: docker pull pactfoundation/pact-cli:latest | |
- name: Can I deploy? | |
run: | | |
docker run --rm \ | |
pactfoundation/pact-cli:latest \ | |
broker can-i-deploy \ | |
--broker-base-url=${PACT_BROKER_BASE_URL} \ | |
--broker-token ${PACT_BROKER_TOKEN} \ | |
--pacticipant ${PACT_PACTICIPANT} \ | |
--version ${GIT_COMMIT} \ | |
--to prod | |
#TODO: write a real deploy script | |
deploy: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
needs: can-i-deploy | |
steps: | |
- uses: actions/checkout@v2 | |
- run: docker pull pactfoundation/pact-cli:latest | |
- name: Tag version as prod | |
run: | | |
docker run --rm \ | |
pactfoundation/pact-cli:latest \ | |
broker create-version-tag \ | |
--broker-base-url=${PACT_BROKER_BASE_URL} \ | |
--broker-token ${PACT_BROKER_TOKEN} \ | |
--pacticipant ${PACT_PACTICIPANT} \ | |
--version ${GIT_COMMIT} \ | |
--tag prod | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: ${{ secrets.SENTRY_ORG }} | |
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} | |
with: | |
environment: production |