update scala syntax and test on compilation #98
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| tags: [v*] | |
| pull_request: | |
| 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: | |
| - 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: 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/* |