SQLDelight client and related Gradle plugin. #304
This file contains 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: Build | |
on: | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "*.md" | |
push: | |
branches: | |
- master | |
env: | |
ENVIRONMENT: TESTING | |
JVM_OPTS: -Xmx4096M | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=3 -Xmx4096m -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" | |
TERM: dumb | |
jobs: | |
js: | |
name: Test JS | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Hermit | |
run: ./bin/hermit env -r >> $GITHUB_ENV | |
- name: Test | |
run: npm install -g @misk/cli && miskweb ci-build -e | |
jvm: | |
name: Test JVM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Hermit | |
run: ./bin/hermit env -r >> $GITHUB_ENV | |
- name: Start MySQL | |
# There's a race condition here, where it's possible that MySQL hasn't finished starting | |
# up before we try to connect to it. But Kotlin builds are so damn slow it'll never | |
# happen in practice. | |
run: docker run -d -p 3306:3306 --name mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:5.7 --sql-mode="" | |
- name: Cache Gradle packages | |
uses: actions/cache@v1 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Test | |
run: gradle build check -i --parallel --build-cache | |
- name: Publish Test Report | |
if: ${{ always() }} | |
uses: mikepenz/action-junit-report@v3 | |
with: | |
check_name: Test Report - Test JVM | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
name: Publish | |
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'cashapp/backfila' }} | |
needs: [js, jvm] | |
runs-on: ubuntu-latest | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Hermit | |
run: ./bin/hermit env -r >> $GITHUB_ENV | |
- name: Assign a version | |
run: | | |
# Set a version name like "2023.05.26.091805-c1fcb3a". | |
# Note the use of %ct which gets the timestamp in UTC, in seconds since UNIX epoch to | |
# avoid time zone differences leading to non-linear versioning. | |
VERSION="$(TZ=UTC0 git show --quiet --date='format-local:%Y.%m.%d.%H%M%S' --format='%cd')-$(git rev-parse --short=7 HEAD)" | |
echo "VERSION_NAME=$VERSION" >> gradle.properties | |
cat gradle.properties | |
- name: Build Misk Web | |
run: | | |
npm install -g @misk/cli | |
miskweb ci-build -e | |
- name: Publish the artifacts | |
run: | | |
gradle clean publish --stacktrace |