Skip to content

Commit

Permalink
Move test CI from CircleCI to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
adrw committed Feb 1, 2023
1 parent 1f79e14 commit 981f15e
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 345 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/Publish-Website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ jobs:
with:
python-version: 3.8

- name: Configure JDK
uses: actions/setup-java@v1
- name: Cache Gradle packages
uses: actions/cache@v1
with:
java-version: 14
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Prep mkdocs
run: .github/workflows/prepare_mkdocs.sh
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build.yml → .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV

- name: install misk-web
run: |
Expand All @@ -32,7 +31,7 @@ jobs:
run: sed --in-place -e "s/-SNAPSHOT/-$(date +%Y%m%d.%H%M)-$(git rev-parse --short HEAD)/" gradle.properties

- name: Publish the artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository
run: gradle publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test

on:
pull_request:
paths-ignore:
- "docs/**"
- "*.md"
push:
branches:
- master

env:
ENVIRONMENT: TESTING
JVM_OPTS: -Xmx1024M
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=3 -Xmx4096m -Dorg.gradle.configureondemand=true -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
TERM: dumb

jobs:
js:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
cmd:
- npm install -g @misk/cli && miskweb ci-build -e

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Hermit
run: ./bin/hermit env -r >> $GITHUB_ENV

- name: Test
run: ${{ matrix.cmd }}

jvm:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
cmd:
- gradle build check -i --parallel --build-cache

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: ${{ matrix.cmd }}

- name: Publish Test Report
if: ${{ always() }}
uses: mikepenz/action-junit-report@v3
with:
check_name: Test Report - ${{ matrix.cmd }}
report_paths: '**/build/test-results/test/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/prepare_mkdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
set -ex

# Generate the API docs
./gradlew dokkaGfm
gradle dokkaGfm

# Dokka filenames like `-http-url/index.md` don't work well with MkDocs <title> tags.
# Assign metadata to the file's first Markdown heading.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ Note: some instructions here are out of date
Install [Hermit shell hooks](https://cashapp.github.io/hermit/usage/shell/?h=shell) or run the following manually.

```
cd backfila
. ./bin/activate-hermit
$ . ./bin/activate-hermit
```

## Building
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Cutting a Release
"s/\"backfila:\([^\:]*\):[^\"]*\"/\"backfila:\1:$RELEASE_VERSION\"/g" \
`find . -name "README.md"`
miskweb ci-build -e
./gradlew clean uploadArchives
gradle clean uploadArchives
```
5. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the artifact. Or drop it
Expand Down
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,8 @@ subprojects {
}
}
}

// Disable the Gradle wrapper if Gradle is managed by Hermit
tasks.named<Wrapper>("wrapper") {
enabled = false
}
2 changes: 1 addition & 1 deletion client-jooq/jooq-test-regenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ docker run --rm \
echo "waiting for mysql to start up"
waitContainer backfila-jooq-codegen

./gradlew -p client-jooq generateJooq
gradle -p client-jooq generateJooq

docker stop backfila-jooq-codegen
2 changes: 1 addition & 1 deletion deploy_website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cd $DIR

# Generate the API docs
GRADLE_TASKS=$(ls -d misk*/ | cut -f1 -d'/' | awk '{ printf ":%s:dokkaGfm ", $1 }')
./gradlew dokkaGfm
gradle dokkaGfm

# Copy in special files that GitHub wants in the project root.
cat README.md | grep -v 'project website' > docs/index.md
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8'
GROUP=app.cash.backfila
VERSION_NAME=0.1.4-SNAPSHOT


POM_URL=https://github.com/cashapp/backfila/
POM_SCM_URL=https://github.com/cashapp/backfila/
POM_SCM_CONNECTION=scm:git:https://github.com/cashapp/backfila.git
Expand Down
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading

0 comments on commit 981f15e

Please sign in to comment.