Skip to content

Commit

Permalink
github actions refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Blef666 committed Feb 19, 2025
1 parent 15aaaf8 commit 34369cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 77 deletions.
59 changes: 3 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,39 +86,13 @@ jobs:
find $HOME/.sbt -name "*.lock" -delete || true
mima:
uses: softwaremill/github-actions-workflows/.github/workflows/mima.yml@main
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs
# do not run on internal, non-steward PRs since those will be run by push to branch
if: |
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
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # checkout tags so that dynver works properly (we need the version for MiMa)
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache sbt
uses: actions/cache@v2
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier
key: sbt-cache-${{ runner.os }}-JVM-${{ hashFiles('project/build.properties') }}
- name: Check MiMa # disable for major releases
run: sbt -v mimaReportBinaryIssues
- 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
publish:
name: Publish release
Expand Down Expand Up @@ -190,40 +164,13 @@ jobs:
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`
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@v4
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, mima, label ]
runs-on: ubuntu-22.04
steps:
- id: automerge
name: automerge
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"
uses: softwaremill/github-actions-workflows/.github/workflows/auto-merge.yml@main
26 changes: 5 additions & 21 deletions .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,8 @@ on:

jobs:
scala-steward:
runs-on: ubuntu-22.04
env:
JAVA_OPTS: "-Xmx3500M"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
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-opts: '-Xmx3500M'

0 comments on commit 34369cf

Please sign in to comment.