Skip to content

Commit

Permalink
Merge pull request #194 from softwaremill/update-ci
Browse files Browse the repository at this point in the history
Simplify & update CI
  • Loading branch information
adamw authored Sep 3, 2024
2 parents 319f20e + 876723c commit 1c77d96
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ labels:
- "build.sbt"
- "project/plugins.sbt"
- "project/build.properties"
- "project/Dependencies.scala"
- label: "dependency"
authors: ["softwaremill-ci"]
files:
- "build.sbt"
- "project/plugins.sbt"
- "project/build.properties"
- "project/Dependencies.scala"
62 changes: 21 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand Down Expand Up @@ -133,4 +113,4 @@ jobs:
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"
MERGE_METHOD: "squash"
10 changes: 5 additions & 5 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
distribution: 'zulu'
java-version: '21'
cache: 'sbt'
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test-report.yml
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
8 changes: 3 additions & 5 deletions .scala-steward.conf
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."}
]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@ We offer commercial support for sttp and related technologies, as well as develo

## Copyright

Copyright (C) 2023 SoftwareMill [https://softwaremill.com](https://softwaremill.com).
Copyright (C) 2023 SoftwareMill [https://softwaremill.com](https://softwaremill.com).

0 comments on commit 1c77d96

Please sign in to comment.