|
17 | 17 | env:
|
18 | 18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
19 | 19 |
|
| 20 | + |
| 21 | +concurrency: |
| 22 | + group: ${{ github.workflow }} @ ${{ github.ref }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
20 | 25 | jobs:
|
21 | 26 | build:
|
22 | 27 | name: Build and Test
|
23 | 28 | strategy:
|
24 | 29 | matrix:
|
25 | 30 | os: [ubuntu-latest]
|
26 |
| - scala: [2.13.11] |
| 31 | + scala: [2.13] |
27 | 32 | java: [temurin@17, temurin@11]
|
28 | 33 | runs-on: ${{ matrix.os }}
|
| 34 | + timeout-minutes: 60 |
29 | 35 | steps:
|
30 | 36 | - name: Checkout current branch (full)
|
31 |
| - uses: actions/checkout@v3 |
| 37 | + uses: actions/checkout@v4 |
32 | 38 | with:
|
33 | 39 | fetch-depth: 0
|
34 | 40 |
|
35 |
| - - name: Download Java (temurin@17) |
36 |
| - id: download-java-temurin-17 |
37 |
| - if: matrix.java == 'temurin@17' |
38 |
| - uses: typelevel/download-java@v2 |
39 |
| - with: |
40 |
| - distribution: temurin |
41 |
| - java-version: 17 |
42 |
| - |
43 | 41 | - name: Setup Java (temurin@17)
|
| 42 | + id: setup-java-temurin-17 |
44 | 43 | if: matrix.java == 'temurin@17'
|
45 | 44 | uses: actions/setup-java@v3
|
46 | 45 | with:
|
47 |
| - distribution: jdkfile |
| 46 | + distribution: temurin |
48 | 47 | java-version: 17
|
49 |
| - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} |
| 48 | + cache: sbt |
50 | 49 |
|
51 |
| - - name: Download Java (temurin@11) |
52 |
| - id: download-java-temurin-11 |
53 |
| - if: matrix.java == 'temurin@11' |
54 |
| - uses: typelevel/download-java@v2 |
55 |
| - with: |
56 |
| - distribution: temurin |
57 |
| - java-version: 11 |
| 50 | + - name: sbt update |
| 51 | + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' |
| 52 | + run: sbt +update |
58 | 53 |
|
59 | 54 | - name: Setup Java (temurin@11)
|
| 55 | + id: setup-java-temurin-11 |
60 | 56 | if: matrix.java == 'temurin@11'
|
61 | 57 | uses: actions/setup-java@v3
|
62 | 58 | with:
|
63 |
| - distribution: jdkfile |
| 59 | + distribution: temurin |
64 | 60 | java-version: 11
|
65 |
| - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} |
| 61 | + cache: sbt |
66 | 62 |
|
67 |
| - - name: Cache sbt |
68 |
| - uses: actions/cache@v3 |
69 |
| - with: |
70 |
| - path: | |
71 |
| - ~/.sbt |
72 |
| - ~/.ivy2/cache |
73 |
| - ~/.coursier/cache/v1 |
74 |
| - ~/.cache/coursier/v1 |
75 |
| - ~/AppData/Local/Coursier/Cache/v1 |
76 |
| - ~/Library/Caches/Coursier/v1 |
77 |
| - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
| 63 | + - name: sbt update |
| 64 | + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' |
| 65 | + run: sbt +update |
78 | 66 |
|
79 | 67 | - name: Check that workflows are up to date
|
80 | 68 | run: sbt githubWorkflowCheck
|
@@ -111,60 +99,42 @@ jobs:
|
111 | 99 | runs-on: ${{ matrix.os }}
|
112 | 100 | steps:
|
113 | 101 | - name: Checkout current branch (full)
|
114 |
| - uses: actions/checkout@v3 |
| 102 | + uses: actions/checkout@v4 |
115 | 103 | with:
|
116 | 104 | fetch-depth: 0
|
117 | 105 |
|
118 |
| - - name: Download Java (temurin@17) |
119 |
| - id: download-java-temurin-17 |
120 |
| - if: matrix.java == 'temurin@17' |
121 |
| - uses: typelevel/download-java@v2 |
122 |
| - with: |
123 |
| - distribution: temurin |
124 |
| - java-version: 17 |
125 |
| - |
126 | 106 | - name: Setup Java (temurin@17)
|
| 107 | + id: setup-java-temurin-17 |
127 | 108 | if: matrix.java == 'temurin@17'
|
128 | 109 | uses: actions/setup-java@v3
|
129 | 110 | with:
|
130 |
| - distribution: jdkfile |
| 111 | + distribution: temurin |
131 | 112 | java-version: 17
|
132 |
| - jdkFile: ${{ steps.download-java-temurin-17.outputs.jdkFile }} |
| 113 | + cache: sbt |
133 | 114 |
|
134 |
| - - name: Download Java (temurin@11) |
135 |
| - id: download-java-temurin-11 |
136 |
| - if: matrix.java == 'temurin@11' |
137 |
| - uses: typelevel/download-java@v2 |
138 |
| - with: |
139 |
| - distribution: temurin |
140 |
| - java-version: 11 |
| 115 | + - name: sbt update |
| 116 | + if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' |
| 117 | + run: sbt +update |
141 | 118 |
|
142 | 119 | - name: Setup Java (temurin@11)
|
| 120 | + id: setup-java-temurin-11 |
143 | 121 | if: matrix.java == 'temurin@11'
|
144 | 122 | uses: actions/setup-java@v3
|
145 | 123 | with:
|
146 |
| - distribution: jdkfile |
| 124 | + distribution: temurin |
147 | 125 | java-version: 11
|
148 |
| - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} |
| 126 | + cache: sbt |
149 | 127 |
|
150 |
| - - name: Cache sbt |
151 |
| - uses: actions/cache@v3 |
152 |
| - with: |
153 |
| - path: | |
154 |
| - ~/.sbt |
155 |
| - ~/.ivy2/cache |
156 |
| - ~/.coursier/cache/v1 |
157 |
| - ~/.cache/coursier/v1 |
158 |
| - ~/AppData/Local/Coursier/Cache/v1 |
159 |
| - ~/Library/Caches/Coursier/v1 |
160 |
| - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} |
161 |
| - |
162 |
| - - name: Download target directories (2.13.11) |
| 128 | + - name: sbt update |
| 129 | + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' |
| 130 | + run: sbt +update |
| 131 | + |
| 132 | + - name: Download target directories (2.13) |
163 | 133 | uses: actions/download-artifact@v3
|
164 | 134 | with:
|
165 |
| - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13.11 |
| 135 | + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13 |
166 | 136 |
|
167 |
| - - name: Inflate target directories (2.13.11) |
| 137 | + - name: Inflate target directories (2.13) |
168 | 138 | run: |
|
169 | 139 | tar xf targets.tar
|
170 | 140 | rm targets.tar
|
|
0 commit comments