Skip to content

Commit 973eafb

Browse files
committed
ci generate
1 parent 94b8fc0 commit 973eafb

File tree

2 files changed

+61
-53
lines changed

2 files changed

+61
-53
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ name: Continuous Integration
99

1010
on:
1111
pull_request:
12-
branches: ['*']
12+
branches: ['**']
1313
push:
14-
branches: ['*']
14+
branches: ['**']
1515
tags: [v*]
1616

1717
env:
@@ -27,43 +27,45 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: [ubuntu-latest]
30-
scala: [2.12.13, 2.13.6, 3.0.0]
31-
30+
scala: [2.12.20, 2.13.16, 3.3.6]
31+
java: [zulu@8, temurin@17]
3232
runs-on: ${{ matrix.os }}
3333
steps:
3434
- name: Checkout current branch (full)
35-
uses: actions/checkout@v2
35+
uses: actions/checkout@v6
3636
with:
3737
fetch-depth: 0
3838

39-
- name: Setup Java and Scala
40-
uses: olafurpg/setup-scala@v10
39+
- name: Setup Java (zulu@8)
40+
if: matrix.java == 'zulu@8'
41+
uses: actions/setup-java@v5
4142
with:
42-
java-version: ${{ matrix.java }}
43+
distribution: zulu
44+
java-version: 8
45+
cache: sbt
4346

44-
- name: Cache sbt
45-
uses: actions/cache@v2
47+
- name: Setup Java (temurin@17)
48+
if: matrix.java == 'temurin@17'
49+
uses: actions/setup-java@v5
4650
with:
47-
path: |
48-
~/.sbt
49-
~/.ivy2/cache
50-
~/.coursier/cache/v1
51-
~/.cache/coursier/v1
52-
~/AppData/Local/Coursier/Cache/v1
53-
~/Library/Caches/Coursier/v1
54-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
51+
distribution: temurin
52+
java-version: 17
53+
cache: sbt
54+
55+
- name: Setup sbt
56+
uses: sbt/setup-sbt@v1
5557

5658
- name: Check that workflows are up to date
57-
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
59+
run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck
5860

5961
- name: Build project
60-
run: sbt ++${{ matrix.scala }} test
62+
run: sbt '++ ${{ matrix.scala }}' test
6163

6264
- name: Compress target directories
6365
run: tar cf targets.tar target stringdiff/.jvm/target stringdiff/.js/target project/target
6466

6567
- name: Upload target directories
66-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v5
6769
with:
6870
name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }}
6971
path: targets.tar
@@ -75,60 +77,62 @@ jobs:
7577
strategy:
7678
matrix:
7779
os: [ubuntu-latest]
78-
scala: [2.13.6]
79-
80+
scala: [2.13.16]
81+
java: [zulu@8]
8082
runs-on: ${{ matrix.os }}
8183
steps:
8284
- name: Checkout current branch (full)
83-
uses: actions/checkout@v2
85+
uses: actions/checkout@v6
8486
with:
8587
fetch-depth: 0
8688

87-
- name: Setup Java and Scala
88-
uses: olafurpg/setup-scala@v10
89+
- name: Setup Java (zulu@8)
90+
if: matrix.java == 'zulu@8'
91+
uses: actions/setup-java@v5
8992
with:
90-
java-version: ${{ matrix.java }}
93+
distribution: zulu
94+
java-version: 8
95+
cache: sbt
9196

92-
- name: Cache sbt
93-
uses: actions/cache@v2
97+
- name: Setup Java (temurin@17)
98+
if: matrix.java == 'temurin@17'
99+
uses: actions/setup-java@v5
94100
with:
95-
path: |
96-
~/.sbt
97-
~/.ivy2/cache
98-
~/.coursier/cache/v1
99-
~/.cache/coursier/v1
100-
~/AppData/Local/Coursier/Cache/v1
101-
~/Library/Caches/Coursier/v1
102-
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
103-
104-
- name: Download target directories (2.12.13)
105-
uses: actions/download-artifact@v2
101+
distribution: temurin
102+
java-version: 17
103+
cache: sbt
104+
105+
- name: Setup sbt
106+
uses: sbt/setup-sbt@v1
107+
108+
- name: Download target directories (2.12.20)
109+
uses: actions/download-artifact@v6
106110
with:
107-
name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }}
111+
name: target-${{ matrix.os }}-2.12.20-${{ matrix.java }}
108112

109-
- name: Inflate target directories (2.12.13)
113+
- name: Inflate target directories (2.12.20)
110114
run: |
111115
tar xf targets.tar
112116
rm targets.tar
113117
114-
- name: Download target directories (2.13.6)
115-
uses: actions/download-artifact@v2
118+
- name: Download target directories (2.13.16)
119+
uses: actions/download-artifact@v6
116120
with:
117-
name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }}
121+
name: target-${{ matrix.os }}-2.13.16-${{ matrix.java }}
118122

119-
- name: Inflate target directories (2.13.6)
123+
- name: Inflate target directories (2.13.16)
120124
run: |
121125
tar xf targets.tar
122126
rm targets.tar
123127
124-
- name: Download target directories (3.0.0)
125-
uses: actions/download-artifact@v2
128+
- name: Download target directories (3.3.6)
129+
uses: actions/download-artifact@v6
126130
with:
127-
name: target-${{ matrix.os }}-3.0.0-${{ matrix.java }}
131+
name: target-${{ matrix.os }}-3.3.6-${{ matrix.java }}
128132

129-
- name: Inflate target directories (3.0.0)
133+
- name: Inflate target directories (3.3.6)
130134
run: |
131135
tar xf targets.tar
132136
rm targets.tar
133137
134-
- run: sbt ++${{ matrix.scala }} ci-release
138+
- run: sbt ci-release

.github/workflows/clean.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ name: Clean
99

1010
on: push
1111

12+
permissions:
13+
actions: write
14+
1215
jobs:
1316
delete-artifacts:
1417
name: Delete Artifacts
@@ -17,6 +20,7 @@ jobs:
1720
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1821
steps:
1922
- name: Delete artifacts
23+
shell: bash {0}
2024
run: |
2125
# Customize those three lines with your repository and credentials:
2226
REPO=${GITHUB_API_URL}/repos/${{ github.repository }}
@@ -25,7 +29,7 @@ jobs:
2529
ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; }
2630
2731
# A temporary file which receives HTTP response headers.
28-
TMPFILE=/tmp/tmp.$$
32+
TMPFILE=$(mktemp)
2933
3034
# An associative array, key: artifact name, value: number of artifacts of that name.
3135
declare -A ARTCOUNT
@@ -56,4 +60,4 @@ jobs:
5660
printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size
5761
ghapi -X DELETE $REPO/actions/artifacts/$id
5862
done
59-
done
63+
done

0 commit comments

Comments
 (0)