CI clean up to fix lint task and remove Windows / MacOS from matrix (#3122)

* Remove unused travis CI config

* Bump eslint and friends

* Fix lint errors after eslint upgrade

* Remove windows and macos from CI workflow as they are actually running linux

Removes the windows and macos matrix from the CI workflow as they were never actually setting
the OS. Both were running against the "ubuntu-latest" OS. Trying to actually use them would
not work either as neither windows or macos is supported for service containers. A different
means will be needed to test on those platforms. Until that's done, this removes those from
the matrix as we were simply running the same thing 3x for the same node versions.
This commit is contained in:
Sehrope Sarkuni 2024-03-05 15:08:44 -05:00 committed by GitHub
parent 2a8efbee09
commit b4bfd63f63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 483 additions and 462 deletions

View File

@ -21,7 +21,6 @@ jobs:
- run: yarn lint
build:
needs: lint
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
@ -35,9 +34,16 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
node: ['10', '12', '14', '16', '18']
os: [ubuntu-latest, windows-latest, macos-latest]
node:
- '10'
- '12'
- '14'
- '16'
- '18'
os:
- ubuntu-latest
name: Node.js ${{ matrix.node }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
PGUSER: postgres
PGHOST: localhost
@ -47,6 +53,9 @@ jobs:
SCRAM_TEST_PGUSER: scram_test
SCRAM_TEST_PGPASSWORD: test4scram
steps:
- name: Show OS
run: |
uname -a
- run: |
psql \
-c "SET password_encryption = 'scram-sha-256'" \

View File

@ -1,100 +0,0 @@
language: node_js
dist: bionic
before_script: |
yarn build
node packages/pg/script/create-test-tables.js postgresql:///
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
node_js:
- lts/dubnium
- lts/erbium
# node 13.7 seems to have changed behavior of async iterators exiting early on streams
# if 13.8 still has this problem when it comes down I'll talk to the node team about the change
# in the mean time...peg to 13.6
- 13.6
- 14
addons:
postgresql: '10'
matrix:
include:
# Run tests/paths that require password authentication
- node_js: lts/erbium
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres PGPASSWORD=test-password SCRAM_TEST_PGUSER=scram_test SCRAM_TEST_PGPASSWORD=test4scram
before_script: |
sudo -u postgres sed -i \
-e '/^local/ s/trust$/peer/' \
-e '/^host/ s/trust$/md5/' \
/etc/postgresql/10/main/pg_hba.conf
sudo -u postgres psql -c "ALTER ROLE postgres PASSWORD 'test-password'; SELECT pg_reload_conf()"
yarn build
node packages/pg/script/create-test-tables.js postgresql:///
sudo -u postgres -- psql \
-c "SET password_encryption = 'scram-sha-256'" \
-c "CREATE ROLE scram_test login password 'test4scram'"
- node_js: lts/carbon
addons:
postgresql: '9.5'
dist: precise
# Run tests/paths with client certificate authentication
- node_js: lts/*
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres
PGSSLMODE=verify-full
PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt
PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt
PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key
PG_CLIENT_CERT_TEST=1
before_script:
- chmod go= packages/pg/test/tls/test-client.key
- |
sudo sed -i \
-e '/^ssl_cert_file =/d' \
-e '/^ssl_key_file =/d' \
/etc/postgresql/10/main/postgresql.conf
cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf > /dev/null
ssl_cert_file = 'test-server.crt'
ssl_key_file = 'test-server.key'
ssl_ca_file = 'test-client-ca.crt'
- printf 'hostssl all all %s cert\n' 127.0.0.1/32 ::1/128 | sudo tee /etc/postgresql/10/main/pg_hba.conf > /dev/null
- sudo make -C packages/pg/test/tls install DESTDIR=/var/ramfs/postgresql/10/main
- sudo systemctl restart postgresql@10-main
- yarn build
script:
- cd packages/pg
- node test/integration/connection-pool/tls-tests.js
- npm install --no-save pg-native
- node test/integration/connection-pool/tls-tests.js native
# different PostgreSQL versions on Node LTS
- node_js: lts/erbium
addons:
postgresql: '9.3'
- node_js: lts/erbium
addons:
postgresql: '9.4'
- node_js: lts/erbium
addons:
postgresql: '9.5'
- node_js: lts/erbium
addons:
postgresql: '9.6'
# only run lint on latest Node LTS
- node_js: lts/*
script: yarn lint
# PostgreSQL 9.2 only works on precise
- node_js: lts/carbon
addons:
postgresql: '9.2'
dist: precise

View File

@ -20,12 +20,12 @@
"lint": "eslint '*/**/*.{js,ts,tsx}'"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.4.0",
"@typescript-eslint/parser": "^4.4.0",
"eslint": "^7.11.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-prettier": "^5.1.2",
"lerna": "^3.19.0",
"prettier": "3.0.3",
"typescript": "^4.0.3"

View File

@ -1,6 +0,0 @@
language: node_js
node_js:
- '0.10'
- '6.9'
- '8'
after_success: 'npm run coveralls'

View File

@ -111,14 +111,21 @@ export class DatabaseError extends Error implements NoticeOrError {
public file: string | undefined
public line: string | undefined
public routine: string | undefined
constructor(message: string, public readonly length: number, public readonly name: MessageName) {
constructor(
message: string,
public readonly length: number,
public readonly name: MessageName
) {
super(message)
}
}
export class CopyDataMessage {
public readonly name = 'copyData'
constructor(public readonly length: number, public readonly chunk: Buffer) {}
constructor(
public readonly length: number,
public readonly chunk: Buffer
) {}
}
export class CopyResponse {
@ -148,7 +155,10 @@ export class Field {
export class RowDescriptionMessage {
public readonly name: MessageName = 'rowDescription'
public readonly fields: Field[]
constructor(public readonly length: number, public readonly fieldCount: number) {
constructor(
public readonly length: number,
public readonly fieldCount: number
) {
this.fields = new Array(this.fieldCount)
}
}
@ -156,7 +166,10 @@ export class RowDescriptionMessage {
export class ParameterDescriptionMessage {
public readonly name: MessageName = 'parameterDescription'
public readonly dataTypeIDs: number[]
constructor(public readonly length: number, public readonly parameterCount: number) {
constructor(
public readonly length: number,
public readonly parameterCount: number
) {
this.dataTypeIDs = new Array(this.parameterCount)
}
}
@ -172,12 +185,19 @@ export class ParameterStatusMessage {
export class AuthenticationMD5Password implements BackendMessage {
public readonly name: MessageName = 'authenticationMD5Password'
constructor(public readonly length: number, public readonly salt: Buffer) {}
constructor(
public readonly length: number,
public readonly salt: Buffer
) {}
}
export class BackendKeyDataMessage {
public readonly name: MessageName = 'backendKeyData'
constructor(public readonly length: number, public readonly processID: number, public readonly secretKey: number) {}
constructor(
public readonly length: number,
public readonly processID: number,
public readonly secretKey: number
) {}
}
export class NotificationResponseMessage {
@ -192,24 +212,36 @@ export class NotificationResponseMessage {
export class ReadyForQueryMessage {
public readonly name: MessageName = 'readyForQuery'
constructor(public readonly length: number, public readonly status: string) {}
constructor(
public readonly length: number,
public readonly status: string
) {}
}
export class CommandCompleteMessage {
public readonly name: MessageName = 'commandComplete'
constructor(public readonly length: number, public readonly text: string) {}
constructor(
public readonly length: number,
public readonly text: string
) {}
}
export class DataRowMessage {
public readonly fieldCount: number
public readonly name: MessageName = 'dataRow'
constructor(public length: number, public fields: any[]) {
constructor(
public length: number,
public fields: any[]
) {
this.fieldCount = fields.length
}
}
export class NoticeMessage implements BackendMessage, NoticeOrError {
constructor(public readonly length: number, public readonly message: string | undefined) {}
constructor(
public readonly length: number,
public readonly message: string | undefined
) {}
public readonly name = 'notice'
public severity: string | undefined
public code: string | undefined

764
yarn.lock

File diff suppressed because it is too large Load Diff