Skip to content

Commit 31d1ea9

Browse files
scala-steward-botxuwei-k
authored andcommitted
run on GitHub Actions
``` git rebase --strategy-option theirs scala-steward-org/main ```
1 parent f20d2a4 commit 31d1ea9

File tree

8 files changed

+80
-418
lines changed

8 files changed

+80
-418
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
# This file was automatically generated by sbt-github-actions using the
2-
# githubWorkflowGenerate task. You should add and commit this file to
3-
# your git repository. It goes without saying that you shouldn't edit
4-
# this file by hand! Instead, if you wish to make changes, you should
5-
# change your sbt build configuration to revise the workflow description
6-
# to meet your needs, then regenerate this file.
7-
8-
name: Continuous Integration
1+
name: CI
92

103
on:
11-
pull_request:
12-
branches: ['**']
134
push:
14-
branches: ['**']
15-
tags: [v*]
16-
17-
env:
18-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '30 */2 * * *'
198

209

2110
concurrency:
@@ -24,166 +13,17 @@ concurrency:
2413

2514
jobs:
2615
build:
27-
name: Build and Test
28-
strategy:
29-
matrix:
30-
os: [ubuntu-latest]
31-
scala: [2.13]
32-
java: [temurin@21, temurin@17, temurin@11]
33-
runs-on: ${{ matrix.os }}
34-
timeout-minutes: 60
16+
runs-on: ubuntu-latest
3517
steps:
36-
- name: Install sbt
37-
uses: sbt/setup-sbt@v1
38-
39-
- name: Checkout current branch (full)
40-
uses: actions/checkout@v4
41-
with:
42-
fetch-depth: 0
43-
44-
- name: Setup Java (temurin@21)
45-
id: setup-java-temurin-21
46-
if: matrix.java == 'temurin@21'
47-
uses: actions/setup-java@v4
48-
with:
49-
distribution: temurin
50-
java-version: 21
51-
cache: sbt
52-
53-
- name: sbt update
54-
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
55-
run: sbt +update
56-
57-
- name: Setup Java (temurin@17)
58-
id: setup-java-temurin-17
59-
if: matrix.java == 'temurin@17'
60-
uses: actions/setup-java@v4
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-java@v4
6120
with:
62-
distribution: temurin
63-
java-version: 17
64-
cache: sbt
65-
66-
- name: sbt update
67-
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
68-
run: sbt +update
69-
70-
- name: Setup Java (temurin@11)
71-
id: setup-java-temurin-11
72-
if: matrix.java == 'temurin@11'
73-
uses: actions/setup-java@v4
74-
with:
75-
distribution: temurin
7621
java-version: 11
22+
distribution: adopt
7723
cache: sbt
78-
79-
- name: sbt update
80-
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
81-
run: sbt +update
82-
83-
- name: Check that workflows are up to date
84-
run: sbt githubWorkflowCheck
85-
86-
- uses: coursier/setup-action@v1
87-
with:
88-
apps: scalafmt
89-
90-
- name: Build project
91-
run: sbt '++ ${{ matrix.scala }}' validate
92-
93-
- name: Codecov
94-
uses: codecov/codecov-action@v3
95-
96-
- name: Make target directories
97-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
98-
run: mkdir -p target modules/docs/.jvm/target modules/dummy/.jvm/target modules/core/.jvm/target modules/benchmark/.jvm/target project/target
99-
100-
- name: Compress target directories
101-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
102-
run: tar cf targets.tar target modules/docs/.jvm/target modules/dummy/.jvm/target modules/core/.jvm/target modules/benchmark/.jvm/target project/target
103-
104-
- name: Upload target directories
105-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
106-
uses: actions/upload-artifact@v4
107-
with:
108-
name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}
109-
path: targets.tar
110-
111-
publish:
112-
name: Publish Artifacts
113-
needs: [build]
114-
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
115-
strategy:
116-
matrix:
117-
os: [ubuntu-latest]
118-
java: [temurin@21]
119-
runs-on: ${{ matrix.os }}
120-
steps:
121-
- name: Install sbt
122-
uses: sbt/setup-sbt@v1
123-
124-
- name: Checkout current branch (full)
125-
uses: actions/checkout@v4
126-
with:
127-
fetch-depth: 0
128-
129-
- name: Setup Java (temurin@21)
130-
id: setup-java-temurin-21
131-
if: matrix.java == 'temurin@21'
132-
uses: actions/setup-java@v4
133-
with:
134-
distribution: temurin
135-
java-version: 21
136-
cache: sbt
137-
138-
- name: sbt update
139-
if: matrix.java == 'temurin@21' && steps.setup-java-temurin-21.outputs.cache-hit == 'false'
140-
run: sbt +update
141-
142-
- name: Setup Java (temurin@17)
143-
id: setup-java-temurin-17
144-
if: matrix.java == 'temurin@17'
145-
uses: actions/setup-java@v4
146-
with:
147-
distribution: temurin
148-
java-version: 17
149-
cache: sbt
150-
151-
- name: sbt update
152-
if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false'
153-
run: sbt +update
154-
155-
- name: Setup Java (temurin@11)
156-
id: setup-java-temurin-11
157-
if: matrix.java == 'temurin@11'
158-
uses: actions/setup-java@v4
159-
with:
160-
distribution: temurin
161-
java-version: 11
162-
cache: sbt
163-
164-
- name: sbt update
165-
if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false'
166-
run: sbt +update
167-
168-
- name: Download target directories (2.13)
169-
uses: actions/download-artifact@v4
170-
with:
171-
name: target-${{ matrix.os }}-${{ matrix.java }}-2.13
172-
173-
- name: Inflate target directories (2.13)
174-
run: |
175-
tar xf targets.tar
176-
rm targets.tar
177-
178-
- name: Publish JARs
179-
env:
180-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
181-
PGP_SECRET: ${{ secrets.PGP_SECRET }}
182-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
183-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
184-
run: sbt ci-release
185-
186-
- name: Publish Docker image
187-
run: |
188-
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
189-
sbt core/Docker/publish
24+
- run: echo "${{ secrets.APP_PRIVATE_KEY }}" > key.pem
25+
- uses: coursier/coursier-setup@v1
26+
- run: cs install scalafmt
27+
- run: cs install scalafix
28+
- uses: sbt/setup-sbt@v1
29+
- run: GITHUB_TOKEN=${{ secrets.MY_GITHUB_TOKEN }} sbt -v runSteward || true

.github/workflows/clean.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.jvmopts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-Xms4096m
2+
-Xmx4096m
3+
-Xss6m

build.sbt

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ val projectName = "scala-steward"
1212
val rootPkg = groupId.replace("-", "")
1313
val gitHubOwner = "scala-steward-org"
1414
val gitHubUrl = s"https://github.com/$gitHubOwner/$projectName"
15-
val mainBranch = "main"
16-
val gitHubUserContent = s"https://raw.githubusercontent.com/$gitHubOwner/$projectName/$mainBranch"
15+
val mainBranch = "master"
16+
val gitHubUserContent = s"https://raw.githubusercontent.com/scala-steward-bot/scala-steward/cron"
1717

1818
val moduleCrossPlatformMatrix: Map[String, List[Platform]] = Map(
1919
"benchmark" -> List(JVMPlatform),
@@ -299,6 +299,7 @@ def myCrossProject(name: String): CrossProject =
299299
lazy val commonSettings = Def.settings(
300300
compileSettings,
301301
metadataSettings,
302+
scalacOptions -= "-Xfatal-warnings",
302303
scaladocSettings
303304
)
304305

@@ -442,18 +443,12 @@ runSteward := Def.taskDyn {
442443
val args = Seq(
443444
Seq("--workspace", s"$projectDir/workspace"),
444445
Seq("--repos-file", s"$projectDir/repos.md"),
445-
Seq("--git-author-email", s"dev@$projectName.org"),
446-
Seq("--forge-login", gitHubLogin),
447-
Seq("--git-ask-pass", s"$home/.github/askpass/$gitHubLogin.sh"),
448-
// Seq("--github-app-id", IO.read(gitHubAppDir / "scala-steward.app-id.txt").trim),
449-
// Seq("--github-app-key-file", s"$gitHubAppDir/scala-steward.private-key.pem"),
450-
Seq("--whitelist", s"$home/.cache/coursier"),
451-
Seq("--whitelist", s"$home/.cache/JNA"),
452-
Seq("--whitelist", s"$home/.cache/mill"),
453-
Seq("--whitelist", s"$home/.ivy2"),
454-
Seq("--whitelist", s"$home/.m2"),
455-
Seq("--whitelist", s"$home/.mill"),
456-
Seq("--whitelist", s"$home/.sbt")
446+
Seq("--git-author-email", "[email protected]"),
447+
Seq("--forge-login", "scala-steward-bot"),
448+
Seq("--git-ask-pass", s"$projectDir/git_ask_pass.sh"),
449+
Seq("--disable-sandbox"),
450+
Seq("--github-app-id", "89853"),
451+
Seq("--github-app-key-file", s"$projectDir/key.pem")
457452
).flatten.mkString(" ", " ", "")
458453
(core.jvm / Compile / run).toTask(args)
459454
}.value

git_ask_pass.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
echo ${GITHUB_TOKEN}

0 commit comments

Comments
 (0)