Skip to content

Merge pull request #1598 from dfpc-coe/feature/t-x-d-d #9474

Merge pull request #1598 from dfpc-coe/feature/t-x-d-d

Merge pull request #1598 from dfpc-coe/feature/t-x-d-d #9474

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
contents: read
jobs:
events:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- name: Docker Build Events
run: docker compose build events
- name: Docker Events Lint
run: docker run cloudtak-events:latest npm run lint
- name: Docker Events Check
run: docker run cloudtak-events:latest npm run check
- name: Docker Events Test & Coverage
run: docker run -v ./tasks/events/coverage/:/workspace/tasks/events/coverage cloudtak-events:latest npm run coverage
- name: Docker Folder Permissions
run: docker run -v ./tasks/events/coverage/:/workspace/tasks/events/coverage cloudtak-events:latest chmod -R 777 /workspace/tasks/events/coverage
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tasks/events/coverage/lcov.info
flags: events
retention:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- name: Docker Build Retention
run: docker compose build retention
- name: Docker Retention Check
run: docker run cloudtak-retention:latest npm run check
- name: Docker Retention Test & Coverage
run: docker run -v ./tasks/retention/coverage/:/workspace/tasks/retention/coverage cloudtak-retention:latest npm run coverage
- name: Docker Folder Permissions
run: docker run -v ./tasks/retention/coverage/:/workspace/tasks/retention/coverage cloudtak-retention:latest chmod -R 777 /workspace/tasks/retention/coverage
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tasks/retention/coverage/lcov.info
flags: retention
- name: Docker Retention Run Once
run: docker run cloudtak-retention:latest npm run run-once
pmtiles:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Install
working-directory: ./tasks/pmtiles/
run: npm install
- name: Lint
working-directory: ./tasks/pmtiles/
run: npm run lint
- name: Check
working-directory: ./tasks/pmtiles/
run: npm run check
- name: Test & Coverage
working-directory: ./tasks/pmtiles/
run: npm run coverage
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tasks/pmtiles/coverage/lcov.info
flags: pmtiles
- name: Build
working-directory: ./tasks/pmtiles/
run: npm run build
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- name: Docker Compose Build
run: docker compose up --build -d postgis
- name: Docker API Build
run: docker compose build api
- name: Docker API Lint
run: docker run cloudtak-api:latest npm run lint
- name: Docker Test & Coverage
run: docker run --network cloudtak_default -v ./coverage/:/home/etl/api/coverage -e "POSTGRES=postgres://docker:docker@postgis:5432/gis" cloudtak-api:latest npm run coverage
- name: Docker Folder Permissions
run: docker run --network cloudtak_default -v ./coverage/:/home/etl/api/coverage -e "POSTGRES=postgres://docker:docker@postgis:5432/gis" cloudtak-api:latest chmod -R 777 /home/etl/api/coverage
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: api
- name: Docker Cleanup
run: docker compose kill
web:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 15
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{github.event.pull_request.head.sha || github.sha}}
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
- name: Install
working-directory: ./api/web/
run: npm install --legacy-peer-deps
- name: Lint
working-directory: ./api/web/
run: npm run lint
- name: Check
working-directory: ./api/web/
run: npm run check
- name: Build Types
working-directory: ./api/web/
run: npm run build:types
- name: Build TypeDocs
working-directory: ./api/web/
run: npm run doc
- name: Test & Coverage
working-directory: ./api/web/
run: npm run coverage
- name: Upload coverage to Codecov
if: ${{ env.CODECOV_TOKEN != '' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./api/web/coverage/lcov.info
flags: web