diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml new file mode 100644 index 000000000..bff4f471a --- /dev/null +++ b/.github/workflows/postgres.yml @@ -0,0 +1,27 @@ +name: Postgres all +on: + schedule: + - cron: '0 20 * * *' + workflow_dispatch: # Manual execution + +jobs: + test: + runs-on: ubuntu-latest + name: Node.js ${{ matrix.node }} + + strategy: + fail-fast: true + matrix: + node: [18] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + + - run: npm ci + - run: npm test:all -w postgres -- --maxWorkers=1 + env: + FORCE_COLOR: true diff --git a/postgres/package.json b/postgres/package.json index 4da4392b1..f30af5d4f 100644 --- a/postgres/package.json +++ b/postgres/package.json @@ -28,7 +28,11 @@ }, "scripts": { "test": "npm start && jest --silent", - "start": "docker-compose -f pg-stack.yml up -d" + "test:all": "npm run test:14 && npm run test:15 && npm run test:16", + "test:14": "VER=14 npm run test", + "test:15": "VER=15 npm run test", + "test:16": "VER=16 npm run test", + "start": "docker-compose -p postgres down && VER=\"${VER:-16}\" docker-compose -f pg-stack.yml up -d" }, "dependencies": { "@cap-js/db-service": "^1.3.1", diff --git a/postgres/pg-stack.yml b/postgres/pg-stack.yml index c88c308b9..3609c3d64 100644 --- a/postgres/pg-stack.yml +++ b/postgres/pg-stack.yml @@ -3,7 +3,7 @@ version: '3.1' services: db: - image: postgres:16-alpine + image: postgres:${VER}-alpine restart: always environment: POSTGRES_PASSWORD: postgres