forked from zio/zio-sqs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate CI to Github actions (zio#479)
- Loading branch information
Showing
9 changed files
with
193 additions
and
149 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* @ghostdogpr | ||
.github/workflows/ @softinio @mijicd | ||
build.sbt @softinio @mijicd | ||
project/BuildHelper.scala @softinio @mijicd | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name-template: 'v$NEXT_PATCH_VERSION' | ||
tag-template: 'v$NEXT_PATCH_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
labels: | ||
- 'build' | ||
- title: '🌱 Dependency Updates' | ||
labels: | ||
- 'dependency-update' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
template: | | ||
## Changes | ||
$CHANGES |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Auto approve | ||
|
||
on: | ||
pull_request_target | ||
|
||
jobs: | ||
auto-approve: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: hmarr/[email protected] | ||
if: github.actor == 'scala-steward' | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
push: | ||
branches: ['master'] | ||
tags: ['v*'] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Checkout current branch | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Scala and Java | ||
uses: olafurpg/setup-scala@v10 | ||
- name: Cache scala dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
~/.m2 | ||
~/.cache | ||
key: sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
- name: Lint code | ||
run: sbt check | ||
|
||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java: ['[email protected]', '[email protected]'] | ||
scala: ['2.12.10', '2.13.3'] | ||
steps: | ||
- name: Checkout current branch | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Scala and Java | ||
uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: Cache scala dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
~/.m2 | ||
~/.cache | ||
key: sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
- name: Run tests | ||
run: sbt ++${{ matrix.scala }}! test | ||
|
||
publish: | ||
runs-on: ubuntu-20.04 | ||
needs: [lint, test] | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- name: Checkout current branch | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Scala and Java | ||
uses: olafurpg/setup-scala@v10 | ||
- name: Cache scala dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.ivy2/cache | ||
~/.sbt | ||
~/.m2 | ||
~/.cache | ||
key: sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} | ||
- name: Setup GPG | ||
uses: olafurpg/setup-gpg@v3 | ||
- name: Release artifacts | ||
run: sbt ci-release | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Clean | ||
|
||
on: push | ||
|
||
jobs: | ||
delete-artifacts: | ||
name: Delete artifacts | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Delete artifacts | ||
run: | | ||
# Customize those three lines with your repository and credentials: | ||
REPO=${GITHUB_API_URL}/repos/${{ github.repository }} | ||
# A shortcut to call GitHub API. | ||
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } | ||
# A temporary file which receives HTTP response headers. | ||
TMPFILE=/tmp/tmp.$$ | ||
# An associative array, key: artifact name, value: number of artifacts of that name. | ||
declare -A ARTCOUNT | ||
# Process all artifacts on this repository, loop on returned "pages". | ||
URL=$REPO/actions/artifacts | ||
while [[ -n "$URL" ]]; do | ||
# Get current page, get response headers in a temporary file. | ||
JSON=$(ghapi --dump-header $TMPFILE "$URL") | ||
# Get URL of next page. Will be empty if we are at the last page. | ||
URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*<//' -e 's/>.*//') | ||
rm -f $TMPFILE | ||
# Number of artifacts on this page: | ||
COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') )) | ||
# Loop on all artifacts on this page. | ||
for ((i=0; $i < $COUNT; i++)); do | ||
# Get name of artifact and count instances of this name. | ||
name=$(jq <<<$JSON -r ".artifacts[$i].name?") | ||
ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1)) | ||
id=$(jq <<<$JSON -r ".artifacts[$i].id?") | ||
size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") )) | ||
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size | ||
ghapi -X DELETE $REPO/actions/artifacts/$id | ||
done | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") | ||
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1") | ||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") | ||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5") | ||
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") | ||
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5") |