diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..849dbe1 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing to Fluent's PostgreSQL Driver + +👋 Welcome to the Vapor team! + +## Docker + +In order to build and test against Postgres, you will need a database running. The easiest way to do this is using Docker and the included `docker-compose.yml` file. + +If you have Docker installed on your computer, all you will need to do is: + +```sh +docker-compose up +``` + +This will start the two databases required for running this package's unit tests. + +## Xcode + +To open the project in Xcode: + +- Clone the repo to your computer +- Drag and drop the folder onto Xcode + +To test within Xcode, press `CMD+U`. + +## SPM + +To develop using SPM, open the code in your favorite code editor. Use the following commands from within the project's root folder to build and test. + +```sh +swift build +swift test +``` + +## SemVer + +Vapor follows [SemVer](https://semver.org). This means that any changes to the source code that can cause +existing code to stop compiling _must_ wait until the next major version to be included. + +Code that is only additive and will not break any existing code can be included in the next minor release. + +---------- + +Join us on Discord if you have any questions: [vapor.team](http://vapor.team). + +— Thanks! 🙌 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 0a22eec..b67cb67 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ -github: [tanner0101] # loganwright, joscdk +github: [tanner0101] open_collective: vapor diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 737edb9..882a93c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,39 +30,29 @@ jobs: - postgres:11 - postgres:12 - postgres:13 - include: - - depscmd: 'apt-get -q update && apt-get -q install -y postgresql-client' - - image: swiftlang/swift:nightly-master-centos8 - depscmd: 'dnf install -y postgresql' - - image: swiftlang/swift:nightly-master-amazonlinux2 - depscmd: 'yum install -y postgresql' container: ${{ matrix.image }} services: postgres-a: image: ${{ matrix.dbimage }} - env: { POSTGRES_USER: vapor_username, POSTGRES_PASSWORD: vapor_password, POSTGRES_DB: vapor_database } + env: + POSTGRES_USER: vapor_username + POSTGRES_PASSWORD: vapor_password + POSTGRES_DB: vapor_database postgres-b: image: ${{ matrix.dbimage }} - env: { POSTGRES_USER: vapor_username, POSTGRES_PASSWORD: vapor_password, POSTGRES_DB: vapor_database } + env: + POSTGRES_USER: vapor_username + POSTGRES_PASSWORD: vapor_password + POSTGRES_DB: vapor_database env: POSTGRES_HOSTNAME_A: postgres-a POSTGRES_HOSTNAME_B: postgres-b - PGUSER: vapor_username - PGPASSWORD: vapor_password + LOG_LEVEL: info steps: - - name: Install dependencies - run: ${{ matrix.depscmd }} - - name: Compensate for AmazonLinux2's Postgres - if: ${{ endsWith(matrix.image, 'amazonlinux2') }} - run: printf '#!/bin/bash\nexec psql "$@" /usr/bin/pg_isready && chmod 0755 /usr/bin/pg_isready - - name: Wait for database servers to be ready - run: until pg_isready -hpostgres-a -dvapor_database && pg_isready -hpostgres-b -dvapor_database; do sleep 1; done - timeout-minutes: 2 - name: Checkout code uses: actions/checkout@v2 - name: Run tests with Thread Sanitizer run: swift test --enable-test-discovery --sanitize=thread - macOS: strategy: fail-fast: false @@ -79,7 +69,8 @@ jobs: steps: - name: Select latest available Xcode uses: maxim-lobanov/setup-xcode@1.0 - with: { 'xcode-version': 'latest' } + with: + xcode-version: latest - name: Replace Postgres install and start server run: | brew uninstall --force postgresql php && rm -rf /usr/local/{etc,var}/{postgres,pg}* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index e8159e2..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,37 +0,0 @@ -# Contributing to Fluent PostgreSQL - -👋 Welcome to the Vapor team! - -## Bootstrap - -To prepare your computer for developing this package, you can run the bootstrap script. - -```sh -./contribute_boostrap.sh -``` - -This script will start up a PostgreSQL docker container to test against. It will also generate and open Xcode for you. - -Be careful to observe the script's output, it may have errors or ask you to do additional steps manually. - -## Testing - -Once in Xcode, select the `FluentPostgreSQL-Package` scheme and use `CMD+U` to run the tests. - -Please add tests to cover bug fixes and new features. - -If you are fixing a single GitHub issue in particular, you can add a test named `testGH` to ensure -that your fix is working. This will also help prevent regression. - -## SemVer - -Vapor follows [SemVer](https://semver.org). This means that any changes to the source code that can cause -existing code to stop compiling _must_ wait until the next major version to be included. - -Code that is only additive and will not break any existing code can be included in the next minor release. - ----------- - -Join us on Slack if you have any questions: [http://vapor.team](http://vapor.team). - -— Thanks! 🙌 diff --git a/Package.swift b/Package.swift index 7bd75a1..ad601db 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( .library(name: "FluentPostgresDriver", targets: ["FluentPostgresDriver"]), ], dependencies: [ - .package(url: "https://github.com/vapor/fluent-kit.git", from: "1.0.0-rc.2.7"), + .package(url: "https://github.com/vapor/fluent-kit.git", from: "1.0.0"), .package(url: "https://github.com/vapor/postgres-kit.git", from: "2.0.0"), ], targets: [ diff --git a/contribute_boostrap.sh b/contribute_boostrap.sh deleted file mode 100755 index 2ee0796..0000000 --- a/contribute_boostrap.sh +++ /dev/null @@ -1,8 +0,0 @@ -echo "💧 generating xcode proj..." -swift package generate-xcodeproj - -echo "💧 opening xcode..." -open *.xcodeproj - -echo "💧 starting docker..." -docker-compose up psql-10 diff --git a/docker-compose.yml b/docker-compose.yml index c53cceb..13b7a21 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,36 +1,19 @@ version: '3' services: - psql-11-a: - image: postgres:11 + a: + image: postgres environment: POSTGRES_USER: vapor_username POSTGRES_DB: vapor_database POSTGRES_PASSWORD: vapor_password ports: - 5432:5432 - psql-11-b: - image: postgres:11 + b: + image: postgres environment: POSTGRES_USER: vapor_username POSTGRES_DB: vapor_database POSTGRES_PASSWORD: vapor_password ports: - 5433:5432 - psql-10: - image: postgres:10 - environment: - POSTGRES_USER: vapor_username - POSTGRES_DB: vapor_database - POSTGRES_PASSWORD: vapor_password - ports: - - 5432:5432 - psql-9: - image: postgres:9 - environment: - POSTGRES_USER: vapor_username - POSTGRES_DB: vapor_database - POSTGRES_PASSWORD: vapor_password - ports: - - 5432:5432 - diff --git a/test.Dockerfile b/test.Dockerfile deleted file mode 100644 index 30c8ea0..0000000 --- a/test.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM swift -COPY ./Sources Sources -COPY ./Tests Tests -COPY ./Package.swift Package.swift -RUN swift package update -RUN swift package edit Core --revision fluent-gm -CMD swift test