Skip to content

fix(): pin typeorm ^0.3.20 #978

fix(): pin typeorm ^0.3.20

fix(): pin typeorm ^0.3.20 #978

Workflow file for this run

name: code
on:
push:
branches:
- main
paths:
- .github/workflows/code.yaml
- package.json
- tsconfig.json
- src/*
- test/**/*.ts
pull_request:
paths:
- .github/workflows/code.yaml
- package.json
- tsconfig.json
- src/*
- test/**/*.ts
- types/**/*.ts
env:
DOCKER_CONTEXT_PATH: .
DOCKERFILE: Dockerfile
PACKAGE: dellingr
jobs:
test_unit:
name: Build, Lint, & Unit Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.4]
steps:
- name: Checkout git repository
uses: actions/checkout@v3
- name: Using node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install yarn
run: yarn install --immutable
- name: Build package
run: yarn build
- name: Lint package
run: yarn lint
- name: Run package unit tests
run: yarn test:unit
test_integration:
name: Test Integration
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.4]
steps:
- name: Checkout git repository
uses: actions/checkout@v3
- name: Copy db init scripts
run: |
sudo mkdir -p /home/scripts/db
sudo cp -r ${{ github.workspace }}/scripts/db/* /home/scripts/db/
sudo chmod 777 /home/scripts/db
- name: Using node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install yarn
run: yarn install --immutable
- name: Run package integration tests
run: yarn test:integration:ci
services:
localstack:
image: localstack/localstack:latest
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
DEFAULT_REGION: eu-west-1
SERVICES: s3
ports:
- 4510-4559:4510-4559
- 4566:4566
postgres:
image: postgres:14-alpine
env:
POSTGRES_DB: dellingr
POSTGRES_PORT: 5432
POSTGRES_PASSWORD: masterkey
POSTGRES_USER: admin
ports:
- 5432:5432
options: >-
-v /home/scripts/db:/docker-entrypoint-initdb.d
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
AWS__ACCESS_KEY_ID: test
AWS__ENDPOINT: http://0.0.0.0:4566
AWS__REGION: eu-west-1
AWS__SECRET_ACCESS_KEY: test
DATABASE__CREDENTIALS__DATABASE: dellingr
DATABASE__CREDENTIALS__SCHEMA: public
DATABASE__CREDENTIALS__HOST: 0.0.0.0
DATABASE__CREDENTIALS__PORT: 5432
DATABASE__CREDENTIALS__PASSWORD: masterkey
DATABASE__CREDENTIALS__USERNAME: admin
SEED_ENVIRONMENT: true
docker:
if: github.ref == 'refs/heads/main'
name: docker build and publish
runs-on: ubuntu-latest
needs:
- test_unit
- test_integration
steps:
- name: Checkout git repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nicolaspearson
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push latest version
uses: docker/build-push-action@v3
with:
build-args: |
GITHUB_SHA=${{ github.sha }}
cache-from: type=registry,ref=ghcr.io/nicolaspearson/${{ env.PACKAGE }}
cache-to: type=inline
context: ${{ env.DOCKER_CONTEXT_PATH }}
file: ${{ env.DOCKERFILE }}
platforms: linux/amd64
push: true
tags: |
ghcr.io/nicolaspearson/${{ env.PACKAGE }}:latest
ghcr.io/nicolaspearson/${{ env.PACKAGE }}:${{ github.sha }}