Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 13 additions & 88 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,102 +6,27 @@ on:
branches: [ master ]
tags: [ v* ]
jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
cache: 'sbt'
- name: Compile
run: sbt -v compile
- name: Compile documentation
run: sbt -v compileDocumentation
- name: Test
run: sbt -v test
- uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: 'tests-results-${{ matrix.scala-version }}-${{ matrix.target-platform }}-${{ matrix.java }}'
path: '**/test-reports/TEST*.xml'
build:
uses: softwaremill/github-actions-workflows/.github/workflows/build-scala.yml@main
with:
java-version: '21'
compile-documentation: true

publish:
name: Publish release
needs: [ci]
uses: softwaremill/github-actions-workflows/.github/workflows/publish-release.yml@main
needs: [build]
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
- name: Compile
run: sbt compile
- name: Publish artifacts
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Extract version from commit message
run: |
version=${GITHUB_REF/refs\/tags\/v/}
echo "VERSION=$version" >> $GITHUB_ENV
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
- name: Publish release notes
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
publish: true
name: "v${{ env.VERSION }}"
tag: "v${{ env.VERSION }}"
version: "v${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
secrets: inherit
with:
java-version: '21'

# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a
# whitelist specified by `labeler.yml`
label:
name: Attach automerge label
# only for PRs by softwaremill-ci
if: github.event.pull_request.user.login == 'softwaremill-ci'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
# count number of files changed
- name: Count number of files changed
id: count-changed-files
run: |
N=$(git diff --name-only -r HEAD^1 HEAD | wc -w)
echo "changed_files_num=$N" >> $GITHUB_OUTPUT
- name: Launch labeler
# skip if more than one file changed
if: steps.count-changed-files.outputs.changed_files_num == 1
uses: srvaroa/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
uses: softwaremill/github-actions-workflows/.github/workflows/label.yml@main

auto-merge:
name: Auto merge
# only for PRs by softwaremill-ci
if: github.event.pull_request.user.login == 'softwaremill-ci'
needs: [ ci, label ]
runs-on: ubuntu-22.04
steps:
- id: automerge
name: automerge
uses: "pascalgn/automerge-action@v0.15.6"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"
needs: [ build, label ]
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
16 changes: 4 additions & 12 deletions .github/workflows/rebase-cmd-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@ on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
# to fast-skip for typical, non-rebase comments
if: contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}
commands: rebase
permission: write
issue-type: pull-request
rebase-cmd-dispatch:
uses: softwaremill/github-actions-workflows/.github/workflows/rebase-cmd-dispatch.yml@main
secrets:
repo-github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
18 changes: 3 additions & 15 deletions .github/workflows/rebase-cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ on:
types: [rebase-command]
jobs:
rebase:
runs-on: ubuntu-latest
steps:
- uses: peter-evans/rebase@v3
id: rebase
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }} # required so that CI will be triggered, see: https://github.com/peter-evans/create-pull-request/issues/48
head: ${{ github.event.client_payload.pull_request.head.label }}
- name: Add reaction
if: steps.rebase.outputs.rebased-count == 1
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reaction-type: hooray
uses: softwaremill/github-actions-workflows/.github/workflows/rebase-cmd.yml@main
secrets:
repo-github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
23 changes: 5 additions & 18 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,8 @@ on:

jobs:
scala-steward:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
cache: 'sbt'
- name: Launch Scala Steward
uses: scala-steward-org/scala-steward-action@v2
with:
author-name: scala-steward
author-email: scala-steward
github-token: ${{ secrets.REPO_GITHUB_TOKEN }}
repo-config: .scala-steward.conf
ignore-opts-files: false
uses: softwaremill/github-actions-workflows/.github/workflows/scala-steward.yml@main
secrets:
repo-github-token: ${{secrets.REPO_GITHUB_TOKEN}}
with:
java-version: '21'
13 changes: 2 additions & 11 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,5 @@ permissions:
checks: write

jobs:
report:
runs-on: ubuntu-latest
# 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
test-report:
uses: softwaremill/github-actions-workflows/.github/workflows/test-report.yml@main
Loading