Skip to content

feat(closure): closure metrics #231

feat(closure): closure metrics

feat(closure): closure metrics #231

Workflow file for this run

name: pull_request
on: [pull_request, workflow_dispatch]
permissions:
contents: read
pull-requests: read
env:
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: postgres
DB_USERNAME: postgres
DB_PASSWORD: postgres
DB_SCHEMA: osm_sync_tracker
jobs:
eslint:
name: Run Linters
runs-on: ubuntu-latest
strategy:
matrix:
node: [24.x]
steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v5
- name: Init Nodejs
uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1
with:
node-version: ${{ matrix.node }}
- name: Run TS Project linters
uses: wearerequired/lint-action@v2
with:
eslint: true
prettier: true
eslint_extensions: ts
tsc: true
openapi-lint:
name: Run OpenAPI lint Check
runs-on: ubuntu-latest
steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v5
- name: Init Nodejs
uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1
- name: OpenAPI Lint Checks
run: npx @redocly/cli lint --format=github-actions openapi3.yaml
tests:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
node: [24.x]
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD}}
POSTGRES_USER: ${{ env.DB_USERNAME }}
POSTGRES_DB: ${{ env.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out Git repository
uses: actions/checkout@v5
- name: Init Nodejs
uses: MapColonies/shared-workflows/actions/init-npm@init-npm-v1
with:
node-version: ${{ matrix.node }}
- name: Install pg client
run: |
sudo apt-get update && sudo apt-get install -y lsb-release
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list > /dev/null
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /usr/share/keyrings/postgresql-keyring.asc > /dev/null
echo "deb [signed-by=/usr/share/keyrings/postgresql-keyring.asc] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list > /dev/null
sudo apt-get update
sudo apt-get install -y postgresql-client
shell: bash
- name: Create schema
run: psql -h $DB_HOST -d $DB_NAME -U $DB_USERNAME -c 'CREATE SCHEMA osm_sync_tracker;'
env:
PGPASSWORD: ${{ env.DB_PASSWORD }}
- name: Run migrations
run: npm run migration:run
- name: Run tests
run: npm run test
- uses: actions/upload-artifact@v4
with:
name: Test Reporters Node-${{ matrix.node }}
path: reports/**
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
build_docker_image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Build and Push Docker image
uses: docker/build-push-action@v6
build_docker_migrations_image:
name: Build Docker Migrations Image
runs-on: ubuntu-latest
steps:
- name: Check out TS Project Git repository
uses: actions/checkout@v5
- name: build migrations Docker image
run: docker build -f ./migrations.Dockerfile -t test-migrations-build:latest .