Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
8db8b83
make code generator sbt independent, drop Scala 2 support
rolang Jun 16, 2025
f1d2197
update ci compile command
rolang Jun 16, 2025
3c784f8
update test
rolang Jun 22, 2025
c0dedbf
update scalafmt
rolang Jun 22, 2025
8a82962
update code generator and move files
rolang Jul 9, 2025
0a4d698
reorganize imports, update scalafmt
rolang Jul 10, 2025
9822dd6
generate readme
rolang Jul 10, 2025
5515215
update usage example
rolang Jul 10, 2025
da59e92
update free port impl
rolang Jul 10, 2025
2cd7f55
use migratiion files hash for caching, add tests
rolang Jul 10, 2025
768cad9
update ouput dir and logs
rolang Jul 10, 2025
c5d1088
add ci job matrix
rolang Jul 10, 2025
04abc87
try adding docker to macos
rolang Jul 10, 2025
65c4ac5
update ci
rolang Jul 10, 2025
ea8db29
add libpg on macos
rolang Jul 10, 2025
4e3d566
updat ci build on macos
rolang Jul 10, 2025
6bd5864
add ci publish step
rolang Jul 10, 2025
ff3cec3
add example usage in sbt
rolang Jul 10, 2025
77b9cac
test ci publish step
rolang Jul 10, 2025
fe861b2
update ouput directory
rolang Jul 10, 2025
7eefa9f
update publish step
rolang Jul 10, 2025
a0a8c5d
add zipped version
rolang Jul 10, 2025
6f3c4f6
update zip file
rolang Jul 10, 2025
c9f0f02
add connection config
rolang Jul 10, 2025
672082b
update code generator and test
rolang Jul 11, 2025
ddbc70b
update docs
rolang Jul 11, 2025
eb97856
update docs
rolang Jul 11, 2025
dfd8642
add custom migration command support
rolang Jul 11, 2025
d2f0123
update exit code and test
rolang Jul 11, 2025
42a8755
add required packages for test
rolang Jul 11, 2025
a210801
move required packages for test
rolang Jul 11, 2025
3a656b4
try brew link
rolang Jul 11, 2025
6e9401d
add linker env
rolang Jul 11, 2025
c784d17
update LD_LIBRARY_PATH
rolang Jul 11, 2025
c90106c
remove brew packages / disable test in ci
rolang Jul 11, 2025
8ce792a
strip quotes from arguments, add debug log
rolang Jul 11, 2025
6f8cabc
re-implement flyway migrations execution, update docs
rolang Jul 12, 2025
a07fd2a
fix compiler warning
rolang Jul 12, 2025
499bfc0
update log level
rolang Jul 12, 2025
fdacd9f
update docs
rolang Jul 12, 2025
425f221
update generated implicit val to given
rolang Jul 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .git-blame-ignore-revs

This file was deleted.

101 changes: 53 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,60 @@ concurrency:
group: ${{ github.workflow }} @ ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@main
with:
jvm: temurin:21
- name: Install libpq (macOS)
if: runner.os == 'macOS'
run: brew install libpq && brew link --force libpq
- run: |
OUT=out/skunk-codegen-$(uname -m)-$(uname | tr '[:upper:]' '[:lower:]')
echo "Compiling to $OUT"
scala-cli --power package \
--native \
--native-mode release-fast PgCodeGen.scala \
-o $OUT -f && \
zip -j "${OUT}.zip" $OUT
- name: Upload command line binaries
uses: actions/upload-artifact@v4
with:
name: codegen-bin-${{ matrix.os }}
path: out/*
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt
- name: Start up Postgres
run: docker run --rm -d -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:16-alpine
- name: Generate code
run: sbt '+core/Test/runMain com.anymindgroup.RunPgCodeGen'
- name: Test generated code
run: sbt '++2.13 Test/runMain com.anymindgroup.GeneratedCodeTest; ++3.3 Test/runMain com.anymindgroup.GeneratedCodeTest'
- name: Test sbt plugin
# for sbt < v2 which only supports scala 2.12
run: sbt ++2.12 scripted
release:
name: Release
runs-on: ubuntu-latest
continue-on-error: false
needs:
- test
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- uses: VirtusLab/scala-cli-setup@main
with:
jvm: temurin:21
- run: ./test.sh

publish-bin:
name: Publish command line binaries
needs: [build]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt
- name: Import signing key and strip passphrase
if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != ''
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
run: |
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
(echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
- name: Release
run: sbt '++2.12 publishSigned; sonatypeCentralRelease'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
- name: Download command line binaries
uses: actions/download-artifact@v4
with:
pattern: codegen-bin-*
path: out
merge-multiple: true

- name: Upload release binaries
uses: softprops/action-gh-release@v1
with:
files: out/*
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ target/
.vscode/
.bloop/
metals.sbt
modules/core/src/test/scala-*/com/anymindgroup/generated/
modules/core/src/test/scala-*/com/anymindgroup/GeneratedCodeTest.scala
test-generated
.scala-build/
out
29 changes: 5 additions & 24 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
version = "3.7.7"
version = "3.9.7"
maxColumn = 120
align.preset = most
align.multiline = false
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
docstrings.style = Asterisk
docstrings.wrapMaxColumn = 80
lineEndings = preserve
trailingCommas = multiple
includeCurlyBraceInSelectChains = false
danglingParentheses.preset = true
optIn.annotationNewlines = true
newlines.alwaysBeforeMultilineDef = false
runner.dialect = scala3
rewrite.rules = [RedundantBraces]
indentOperator.exemptScope = aloneArgOrBody
indentOperator.excludeRegex = "^(&&|\\|\\|)$"
project.excludeFilters = []

rewrite.redundantBraces.generalExpressions = false
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
rewrite.rules = [Imports]
rewrite.imports.sort = scalastyle
rewrite.imports.expand = false
rewrite.imports.groups = [["scala\\..*"], ["java\\..*"]]
Loading
Loading