Skip to content

Commit 5cbda49

Browse files
committed
ci: Update ci settings
1 parent f07d0a6 commit 5cbda49

File tree

7 files changed

+152
-36
lines changed

7 files changed

+152
-36
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
automerge:
2+
- project/Dependencies.scala
3+
- project/plugins.sbt
4+
- .scalafmt.conf

.github/workflows/bump.yml renamed to .github/workflows/bump-version.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Bump Version
22
on:
33
workflow_dispatch:
44
schedule:
5-
- cron: '0 0 * * *'
5+
- cron: '0 6 * * *'
66
jobs:
77
bump-version:
88
runs-on: ubuntu-latest
@@ -12,12 +12,32 @@ jobs:
1212
fetch-depth: 0
1313
persist-credentials: false
1414
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
15+
- name: Calculate changes from the latest tag to HEAD
16+
id: changes
17+
run: |
18+
LATEST_TAG=$(git describe --abbrev=0)
19+
echo "latest-tag = $LATEST_TAG"
20+
COUNT=$(git log $LATEST_TAG..HEAD --pretty=format:"%s" --no-merges \
21+
--grep='^build:' \
22+
--grep='^ci:' \
23+
--grep='^feat:' \
24+
--grep='^fix:' \
25+
--grep='^docs:' \
26+
--grep='^style:' \
27+
--grep='^refactor:' \
28+
--grep='^perf:' \
29+
--grep='^test:' \
30+
--grep='^revert:' \
31+
--grep='^chore:' | awk 'END{print NR}')
32+
echo "steps.changes.outputs.count = $COUNT"
33+
echo "::set-output name=count::$COUNT"
1534
- name: Bump version and push tag
1635
id: tag_version
1736
uses: mathieudutour/github-tag-action@v5.4
1837
with:
1938
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2039
default_bump: patch
40+
if: steps.changes.outputs.count > 0
2141
- name: Create a GitHub release
2242
uses: actions/create-release@v1
2343
env:
@@ -26,4 +46,4 @@ jobs:
2646
tag_name: ${{ steps.tag_version.outputs.new_tag }}
2747
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
2848
body: ${{ steps.tag_version.outputs.changelog }}
29-
49+
if: steps.changes.outputs.count > 0

.github/workflows/ci.yml

Lines changed: 58 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,87 @@
11
name: CI
22
on:
33
push:
4-
branches: [main]
4+
branches:
5+
- main
6+
paths:
7+
- '**.scala'
8+
- '**.java'
9+
- '**.sbt'
10+
- '.scalafmt.conf'
11+
- '.github/workflows/ci.yml'
512
pull_request:
6-
branches: [main]
13+
branches:
14+
- main
15+
paths:
16+
- '**.scala'
17+
- '**.java'
18+
- '**.sbt'
19+
- '.scalafmt.conf'
20+
- '.github/workflows/ci.yml'
721
schedule:
8-
- cron: '0 0 * * *'
22+
- cron: '0 * * * *'
923
jobs:
10-
build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
os: [ ubuntu-latest ]
15-
jdk: [ adopt@1.8, adopt@1.11, adopt@1.14 ]
16-
scala: [ 2.12.13, 2.13.5 ]
17-
runs-on: ${{ matrix.os }}
24+
lint:
25+
runs-on: ubuntu-latest
1826
env:
1927
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
2028
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
21-
AWS_REGION: ap-northeast-1
22-
TEST_TIME_FACTOR: 5
2329
steps:
24-
- uses: actions/checkout@v2.3.4
25-
with:
26-
fetch-depth: 0
27-
- uses: olafurpg/setup-scala@v10
28-
with:
29-
java-version: ${{ matrix.jdk }}
30-
- uses: coursier/cache-action@v5
31-
- run: sbt -v ++${{ matrix.scala }} compile
32-
- name: clean up
33-
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh"
30+
- uses: actions/checkout@v2.3.4
31+
with:
32+
fetch-depth: 0
33+
- uses: olafurpg/setup-scala@v10
34+
with:
35+
java-version: "adopt@1.8"
36+
- uses: coursier/cache-action@v5
37+
- run: sbt -v lint
38+
- name: clean up
39+
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh"
3440
test:
3541
strategy:
3642
fail-fast: false
3743
matrix:
38-
os: [ ubuntu-latest ]
3944
jdk: [ adopt@1.8, adopt@1.11, adopt@1.14 ]
40-
scala: [ 2.12.13, 2.13.5 ]
41-
runs-on: ${{ matrix.os }}
42-
needs: build
45+
scala: [ 2.13.5, 2.12.13 ]
46+
runs-on: ubuntu-latest
47+
needs: lint
4348
env:
4449
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
4550
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
4651
AWS_REGION: ap-northeast-1
47-
TEST_TIME_FACTOR: 5
52+
TEST_TIME_FACTOR: 3
4853
steps:
4954
- uses: actions/checkout@v2.3.4
5055
with:
5156
fetch-depth: 0
5257
- uses: olafurpg/setup-scala@v10
5358
with:
5459
java-version: ${{ matrix.jdk }}
55-
- uses: coursier/cache-action@v5
60+
- uses: coursier/cache-action@v6
5661
- uses: olafurpg/setup-gpg@v3
57-
- run: sbt -v ++${{ matrix.scala }} test
62+
- name: sbt test
63+
run: sbt -v ++${{ matrix.scala }} test
5864
- name: clean up
5965
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh"
66+
automerge:
67+
runs-on: ubuntu-latest
68+
if: github.event_name == 'pull_request'
69+
needs: test
70+
steps:
71+
- name: Generate token
72+
id: generate_token
73+
uses: tibdex/github-app-token@v1
74+
with:
75+
app_id: 111016
76+
private_key: ${{ secrets.MY_SCALA_STEWARD }}
77+
- name: labeler
78+
uses: actions/labeler@v3
79+
with:
80+
repo-token: "${{ steps.generate_token.outputs.token }}"
81+
- name: automerge
82+
uses: pascalgn/automerge-action@v0.13.1
83+
env:
84+
GITHUB_TOKEN: "${{ steps.generate_token.outputs.token }}"
85+
MERGE_LABELS: "automerge"
86+
MERGE_METHOD: "rebase"
87+
MERGE_FILTER_AUTHOR: "my-scala-steward[bot]"

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Release
22
on:
33
push:
4-
branches: [main]
54
tags:
65
- v[1-9]+.[0-9]+.[0-9]+
76
jobs:
@@ -11,13 +10,13 @@ jobs:
1110
matrix:
1211
os: [ ubuntu-latest ]
1312
jdk: [ adopt@1.8, adopt@1.11, adopt@1.14 ]
14-
scala: [ 2.12.13, 2.13.5 ]
13+
scala: [ 2.13.5, 2.12.13 ]
1514
runs-on: ${{ matrix.os }}
1615
env:
1716
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
1817
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
1918
AWS_REGION: ap-northeast-1
20-
TEST_TIME_FACTOR: 5
19+
TEST_TIME_FACTOR: 3
2120
steps:
2221
- uses: actions/checkout@v2.3.4
2322
with:
@@ -31,6 +30,7 @@ jobs:
3130
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh"
3231
release:
3332
runs-on: ubuntu-latest
33+
needs: test
3434
env:
3535
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
3636
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
@@ -41,7 +41,7 @@ jobs:
4141
- uses: olafurpg/setup-scala@v10
4242
with:
4343
java-version: "adopt@1.8"
44-
- uses: coursier/cache-action@v5
44+
- uses: coursier/cache-action@v6
4545
- uses: olafurpg/setup-gpg@v3
4646
- run: sbt -v ci-release
4747
env:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Scala Steward
2+
on:
3+
# push:
4+
# branches:
5+
# - main
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 * * * *'
9+
jobs:
10+
scala-steward:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Generate token
14+
id: generate_token
15+
if: ${{ !github.event.repository.fork }}
16+
uses: tibdex/github-app-token@v1
17+
with:
18+
app_id: 111016
19+
private_key: ${{ secrets.MY_SCALA_STEWARD }}
20+
- uses: scala-steward-org/scala-steward-action@v2
21+
if: ${{ !github.event.repository.fork }}
22+
with:
23+
github-token: ${{ steps.generate_token.outputs.token }}
24+
author-email: "82752207+my-scala-steward[bot]@users.noreply.github.com"
25+
author-name: "my-scala-steward[bot]"
26+
cache-ttl: 0s

.github/workflows/snapshot.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Snapshot
2+
on:
3+
workflow_run:
4+
workflows:
5+
- CI
6+
types:
7+
- completed
8+
jobs:
9+
snapshot:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
12+
env:
13+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
14+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
15+
steps:
16+
- uses: actions/checkout@v2.3.4
17+
with:
18+
ref: ${{ github.event.workflow_run.head_branch }}
19+
fetch-depth: 0
20+
- uses: olafurpg/setup-scala@v10
21+
with:
22+
java-version: "adopt@1.8"
23+
- uses: coursier/cache-action@v6
24+
- uses: olafurpg/setup-gpg@v3
25+
- run: sbt -v ci-release
26+
env:
27+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
28+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
29+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
30+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
31+
- name: clean up
32+
run: "${GITHUB_WORKSPACE}/.github/clean-up.sh"

0 commit comments

Comments
 (0)