generated from softwaremill/sbt-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from softwaremill/update-ci
Simplify & update CI
- Loading branch information
Showing
6 changed files
with
56 additions
and
52 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -13,57 +13,44 @@ jobs: | |
github.event_name == 'push' || | ||
github.event.pull_request.head.repo.full_name != github.repository || | ||
github.event.pull_request.user.login == 'softwaremill-ci' | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache sbt | ||
uses: actions/cache@v2 | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
path: | | ||
~/.sbt | ||
~/.ivy2/cache | ||
~/.coursier | ||
key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }} | ||
distribution: 'zulu' | ||
java-version: '21' | ||
cache: 'sbt' | ||
- name: Compile | ||
run: sbt -v compile | ||
- name: Compile documentation | ||
run: sbt -v compileDocs | ||
- name: Test | ||
run: sbt -v test | ||
- name: Cleanup | ||
run: | | ||
rm -rf "$HOME/.ivy2/local" || true | ||
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true | ||
find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true | ||
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true | ||
find $HOME/.sbt -name "*.lock" -delete || true | ||
- uses: actions/upload-artifact@v4 # upload test results | ||
if: success() || failure() # run this step even if previous step failed | ||
with: | ||
name: 'tests-results' | ||
path: '**/test-reports/TEST*.xml' | ||
|
||
publish: | ||
name: Publish release | ||
needs: [ci] | ||
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
env: | ||
JAVA_OPTS: -Xmx4G | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache sbt | ||
uses: actions/cache@v2 | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
path: | | ||
~/.sbt | ||
~/.ivy2/cache | ||
~/.coursier | ||
key: sbt-cache-${{ runner.os }}-${{ hashFiles('project/build.properties') }} | ||
distribution: 'zulu' | ||
java-version: '21' | ||
cache: 'sbt' | ||
- name: Compile | ||
run: sbt compile | ||
- name: Publish artifacts | ||
|
@@ -89,13 +76,6 @@ jobs: | |
version: "v${{ env.VERSION }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Cleanup | ||
run: | | ||
rm -rf "$HOME/.ivy2/local" || true | ||
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true | ||
find $HOME/.ivy2/cache -name "*-LM-SNAPSHOT*" -delete || true | ||
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true | ||
find $HOME/.sbt -name "*.lock" -delete || true | ||
|
||
# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a | ||
# whitelist specified by `labeler.yml` | ||
|
@@ -133,4 +113,4 @@ jobs: | |
uses: "pascalgn/[email protected]" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
MERGE_METHOD: "squash" | ||
MERGE_METHOD: "squash" |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Test Report' | ||
on: | ||
workflow_run: | ||
workflows: ['CI'] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
|
||
jobs: | ||
report: | ||
runs-on: ubuntu-22.04 | ||
# If the workflow run was skipped or cancelled this action would fail, generating a test report is unnecessary. | ||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: '/tests-results-(.*)/' | ||
name: 'Test report for $1' | ||
path: '**/test-reports/TEST*.xml' | ||
reporter: java-junit |
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,8 +1,6 @@ | ||
updates.ignore = [ | ||
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.13."}, | ||
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "3."} | ||
] | ||
updates.pin = [ | ||
{groupId = "com.typesafe.akka", version = "2.6."}, | ||
{groupId = "org.scala-lang", artifactId = "scala3-library", version = "3.3."}, | ||
{groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."} | ||
{groupId = "org.scala-lang", artifactId = "scala3-library_sjs1", version = "3.3."}, | ||
{groupId = "org.scala-lang", artifactId = "scala-library", version = "2.13."} | ||
] |
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