Skip to content

Commit f3bb4e8

Browse files
Merge pull request #10030 from griggt/partition-community-build
Partition community build for faster CI
2 parents 51077ff + 5b29736 commit f3bb4e8

File tree

2 files changed

+58
-24
lines changed

2 files changed

+58
-24
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
run: sbt ";sjsJUnitTests/test ;sjsCompilerTests/test"
108108
shell: cmd
109109

110-
community_build:
110+
community_build_a:
111111
runs-on: [self-hosted, Linux]
112112
container:
113113
image: lampepfl/dotty:2020-09-08
@@ -133,7 +133,35 @@ jobs:
133133
run: |
134134
git submodule sync
135135
git submodule update --init --recursive --jobs 7
136-
./project/scripts/sbt community-build/test
136+
./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestA"
137+
138+
community_build_b:
139+
runs-on: [self-hosted, Linux]
140+
container:
141+
image: lampepfl/dotty:2020-09-08
142+
volumes:
143+
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
144+
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
145+
- ${{ github.workspace }}/../../cache/general:/root/.cache
146+
147+
steps:
148+
- name: Checkout cleanup script
149+
uses: actions/checkout@v2
150+
151+
- name: Cleanup
152+
run: .github/workflows/cleanup.sh
153+
154+
- name: Git Checkout
155+
uses: actions/checkout@v2
156+
157+
- name: Add SBT proxy repositories
158+
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
159+
160+
- name: Test
161+
run: |
162+
git submodule sync
163+
git submodule update --init --recursive --jobs 7
164+
./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestB"
137165
138166
test_sbt:
139167
runs-on: [self-hosted, Linux]
@@ -208,7 +236,7 @@ jobs:
208236
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
209237
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
210238
- ${{ github.workspace }}/../../cache/general:/root/.cache
211-
needs: [test, test_bootstrapped, community_build, test_sbt, test_java8]
239+
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
212240
if: github.event_name == 'schedule'
213241
env:
214242
NIGHTLYBUILD: yes
@@ -283,7 +311,7 @@ jobs:
283311
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
284312
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
285313
- ${{ github.workspace }}/../../cache/general:/root/.cache
286-
needs: [test, test_bootstrapped, community_build, test_sbt, test_java8]
314+
needs: [test, test_bootstrapped, community_build_a, community_build_b, test_sbt, test_java8]
287315
if: github.event_name == 'push' &&
288316
startsWith(github.event.ref, 'refs/tags/') &&
289317
!startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
@@ -409,7 +437,7 @@ jobs:
409437
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
410438
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
411439
- ${{ github.workspace }}/../../cache/general:/root/.cache
412-
needs: [community_build, test_sbt]
440+
needs: [community_build_a, community_build_b, test_sbt]
413441
if: github.event_name == 'push' &&
414442
startsWith(github.event.ref, 'refs/tags/sbt-dotty-')
415443

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import org.junit.{Ignore, Test}
77
import org.junit.Assert.{assertEquals, fail}
88
import org.junit.experimental.categories.Category
99

10-
@Category(Array(classOf[TestCategory]))
11-
class CommunityBuildTest:
10+
abstract class CommunityBuildTest:
1211
given CommunityBuildTest = this
1312

1413
/** Depending on the mode of operation, either
@@ -79,7 +78,30 @@ class CommunityBuildTest:
7978
|""".stripMargin)
8079
}
8180
}
81+
end CommunityBuildTest
82+
83+
@Category(Array(classOf[TestCategory]))
84+
class CommunityBuildTestA extends CommunityBuildTest:
85+
@Test def fansi = projects.fansi.run()
86+
@Test def fastparse = projects.fastparse.run()
87+
@Test def geny = projects.geny.run()
88+
@Test def oslib = projects.oslib.run()
89+
// @Test def oslibWatch = projects.oslibWatch.run()
90+
@Test def pprint = projects.pprint.run()
91+
@Test def requests = projects.requests.run()
92+
@Test def scalacheck = projects.scalacheck.run()
93+
@Test def scalatest = projects.scalatest.run()
94+
@Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run()
95+
@Test def sourcecode = projects.sourcecode.run()
96+
@Test def scodec = projects.scodec.run()
97+
@Test def scodecBits = projects.scodecBits.run()
98+
@Test def ujson = projects.ujson.run()
99+
@Test def upickle = projects.upickle.run()
100+
@Test def utest = projects.utest.run()
101+
end CommunityBuildTestA
82102

103+
@Category(Array(classOf[TestCategory]))
104+
class CommunityBuildTestB extends CommunityBuildTest:
83105
@Test def algebra = projects.algebra.run()
84106
@Test def betterfiles = projects.betterfiles.run()
85107
@Test def catsEffect2 = projects.catsEffect2.run()
@@ -88,38 +110,22 @@ class CommunityBuildTest:
88110
// @Test def dottyCpsAsync = projects.dottyCpsAsync.run()
89111
@Test def effpi = projects.effpi.run()
90112
@Test def endpoints4s = projects.endpoints4s.run()
91-
@Test def fansi = projects.fansi.run()
92-
@Test def fastparse = projects.fastparse.run()
93-
@Test def geny = projects.geny.run()
94113
@Test def intent = projects.intent.run()
95114
@Test def minitest = projects.minitest.run()
96115
@Test def munit = projects.munit.run()
97-
@Test def oslib = projects.oslib.run()
98-
// @Test def oslibWatch = projects.oslibWatch.run()
99-
@Test def pprint = projects.pprint.run()
100-
@Test def requests = projects.requests.run()
101-
@Test def scalacheck = projects.scalacheck.run()
102116
@Test def scalap = projects.scalap.run()
103117
@Test def scalaParserCombinators = projects.scalaParserCombinators.run()
104118
@Test def ScalaPB = projects.ScalaPB.run()
105-
@Test def scalatest = projects.scalatest.run()
106-
@Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run()
107119
@Test def scalaXml = projects.scalaXml.run()
108120
@Test def scalaz = projects.scalaz.run()
109121
@Test def scas = projects.scas.run()
110-
@Test def scodec = projects.scodec.run()
111-
@Test def scodecBits = projects.scodecBits.run()
112122
@Test def sconfig = projects.sconfig.run()
113123
@Test def scopt = projects.scopt.run()
114124
@Test def shapeless = projects.shapeless.run()
115-
@Test def sourcecode = projects.sourcecode.run()
116125
@Test def squants = projects.squants.run()
117126
@Test def stdLib213 = projects.stdLib213.run()
118-
@Test def ujson = projects.ujson.run()
119-
@Test def upickle = projects.upickle.run()
120-
@Test def utest = projects.utest.run()
121127
@Test def xmlInterpolator = projects.xmlInterpolator.run()
122128
@Test def zio = projects.zio.run()
123-
end CommunityBuildTest
129+
end CommunityBuildTestB
124130

125131
class TestCategory

0 commit comments

Comments
 (0)