Skip to content

Commit

Permalink
Major codebase cleanup (#166)
Browse files Browse the repository at this point in the history
* Massive pass across the entirety of SQLKit to:
- Fix, correct, clarify, add, and streamline documentation comments across the board.
- Use `any` in all places it should appear.
- Normalize coding style (esp. omitting unneeded `return`s and consistent use of `self.`).
- Add `@inlinable` and `@usableFromInline` to a significant amount of the API, hopefully improving performance
- Fix some minor copy-pasta bugs, primarily in SQLCreateTrigger
- Deprecate use of non-trivial raw SQL strings outside of SQLQueryString or SQLRaw
* Update README - had a LOT of old stuff in it
  • Loading branch information
gwynne authored May 7, 2023
1 parent 054ea50 commit 5026e7c
Show file tree
Hide file tree
Showing 99 changed files with 2,177 additions and 2,714 deletions.
28 changes: 4 additions & 24 deletions .github/workflows/projectboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,7 @@ on:
types: [reopened, closed, labeled, unlabeled, assigned, unassigned]

jobs:
setup_matrix_input:
runs-on: ubuntu-latest

steps:
- id: set-matrix
run: |
output=$(curl ${{ github.event.issue.url }}/labels | jq '.[] | .name') || output=""
echo '======================'
echo 'Process incoming data'
echo '======================'
json=$(echo $output | sed 's/"\s"/","/g')
echo $json
echo "::set-output name=matrix::$(echo $json)"
outputs:
issueTags: ${{ steps.set-matrix.outputs.matrix }}

Manage_project_issues:
needs: setup_matrix_input
uses: vapor/ci/.github/workflows/issues-to-project-board.yml@main
with:
labelsJson: ${{ needs.setup_matrix_input.outputs.issueTags }}
secrets:
PROJECT_BOARD_AUTOMATION_PAT: "${{ secrets.PROJECT_BOARD_AUTOMATION_PAT }}"
update_project_boards:
name: Update project boards
uses: vapor/ci/.github/workflows/update-project-boards-for-issue.yml@reusable-workflows
secrets: inherit
80 changes: 28 additions & 52 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request: { branches: ['*'] }
push: { branches: ['main'] }

env:
LOG_LEVEL: debug
LOG_LEVEL: info
SWIFT_DETERMINISTIC_HASHING: 1

jobs:
# Baseline test run for code coverage stats
codecov:
runs-on: ubuntu-latest
container: swift:5.7-jammy
steps:
- name: Check out package
uses: actions/checkout@v3
- name: Run local tests with coverage
run: swift test --enable-code-coverage
- name: Submit coverage report to Codecov.io
uses: vapor/[email protected]
with:
cc_flags: 'unittests'
cc_env_vars: 'SWIFT_VERSION,SWIFT_PLATFORM,RUNNER_OS,RUNNER_ARCH,POSTGRES_VERSION'
cc_fail_ci_if_error: true
cc_verbose: true
cc_dry_run: false

# Check for API breakage versus main
api-breakage:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
container: swift:5.8-jammy
steps:
- name: Check out package
uses: actions/checkout@v3
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/766
- name: Mark the workspace as safe
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Check for API breaking changes
run: swift package diagnose-api-breaking-changes origin/main

unit-tests:
uses: vapor/ci/.github/workflows/run-unit-tests.yml@reusable-workflows
with:
Expand Down Expand Up @@ -100,11 +68,18 @@ jobs:
MYSQL_HOSTNAME_A: mysql-a
MYSQL_HOSTNAME_B: mysql-b
steps:
- name: Install SQLite dependencies
run: apt-get -q update && apt-get -q install -y libsqlite3-dev
- name: Check out sql-kit
uses: actions/checkout@v3
with: { path: sql-kit }
- name: Check out sqlite-kit
uses: actions/checkout@v3
with: { repository: 'vapor/sqlite-kit', path: sqlite-kit }
- name: Check out postgres-kit
uses: actions/checkout@v3
with: { repository: 'vapor/postgres-kit', path: postgres-kit }
- name: Check out mysql-kit
uses: actions/checkout@v3
with: { repository: 'vapor/mysql-kit', path: mysql-kit }
- name: Check out fluent-sqlite-driver
uses: actions/checkout@v3
with: { repository: 'vapor/fluent-sqlite-driver', path: fluent-sqlite-driver }
Expand All @@ -115,28 +90,29 @@ jobs:
uses: actions/checkout@v3
with: { repository: 'vapor/fluent-mysql-driver', path: fluent-mysql-driver }

- name: Use sql-kit in sqlite-kit
run: swift package --package-path sqlite-kit edit sql-kit --path sql-kit
- name: Use sql-kit in postgres-kit
run: swift package --package-path postgres-kit edit sql-kit --path sql-kit
- name: Use sql-kit in mysql-kit
run: swift package --package-path mysql-kit edit sql-kit --path sql-kit
- name: Use sql-kit in fluent-sqlite-driver
run: swift package --package-path fluent-sqlite-driver edit sql-kit --path sql-kit
- name: Use sql-kit in fluent-postgres-driver
run: swift package --package-path fluent-postgres-driver edit sql-kit --path sql-kit
- name: Use sql-kit in fluent-myql-driver
- name: Use sql-kit in fluent-mysql-driver
run: swift package --package-path fluent-mysql-driver edit sql-kit --path sql-kit

- name: Run sqlite-kit tests with Thread Sanitizer
run: swift test --package-path sqlite-kit --sanitize=thread
- name: Run postgres-kit tests with Thread Sanitizer
run: swift test --package-path postgres-kit --sanitize=thread
- name: Run mysql-kit tests with Thread Sanitizer
run: swift test --package-path mysql-kit --sanitize=thread

- name: Run fluent-sqlite-driver tests with Thread Sanitizer
run: swift test --package-path fluent-sqlite-driver
run: swift test --package-path fluent-sqlite-driver --sanitize=thread
- name: Run fluent-postgres-driver tests with Thread Sanitizer
run: swift test --package-path fluent-postgres-driver --sanitize=thread
- name: Run fluent-mysql-driver tests with Thread Sanitizer
run: swift test --package-path fluent-mysql-driver --sanitize=thread

test-exports:
name: Test exports
runs-on: ubuntu-latest
container: swift:5.8-jammy
steps:
- name: Check out Vapor
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build
run: swift build -Xswiftc -DBUILDING_DOCC
Loading

0 comments on commit 5026e7c

Please sign in to comment.