Skip to content

Refactor code to follow Prettier and TSC #1611

Refactor code to follow Prettier and TSC

Refactor code to follow Prettier and TSC #1611

Workflow file for this run

name: Test
on: [push]
jobs:
prettier-check:
runs-on: ubuntu-latest
env:
NODE_VERSION: 22.x
steps:
- uses: actions/checkout@v3
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Run Prettier Check
run: |
npm run lint-prettier
if [ $? -ne 0 ]; then
echo "Prettier check failed."
exit 1
fi
- name: Run ESlint
run: |
npm run lint
if [ $? -ne 0 ]; then
echo "ESlint failed."
exit 1
fi
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
fail-fast: false
# services:
# mongodb:
# image: mongo:4.2.2-bionic
# ports:
# - 27017:27017
steps:
- uses: actions/checkout@v3
- name: Start mongod
shell: bash
run: |
docker run --name mongo -p 27017:27017 -d mongo:4.2.2-bionic --replSet replset
sleep 5s
docker exec mongo /bin/bash -c "echo \"rs.initiate();\" | mongo"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Pull dicom_utility from Docker Hub
run: |
docker pull hello-world
docker pull circuscad/dicom_utility:2.0.0-beta3
docker pull circuscad/dicom_voxel_dump:1.0.0
cd packages/circus-cs-core/test/docker
node build.js
- name: Build modules
run: npm run build-ts
- name: Run TypeScript Check
run: |
npm run typecheck
if [ $? -ne 0 ]; then
echo "TypeScript check failed."
exit 1
fi
- name: Run test
run: npm test -- --max-workers 1
env:
CI: true
CIRCUS_MONGO_TEST_URL: 'mongodb://localhost:27017/circus-api-test'
- name: Stop mongod
if: always()
run: |
docker stop mongo