Skip to content

Commit b95deb5

Browse files
authored
chore(ci): remove tokens and add windows to ci (#313)
1 parent 861bccd commit b95deb5

File tree

7 files changed

+74
-45
lines changed

7 files changed

+74
-45
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,61 @@ jobs:
1919
linux-compat:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: Checkout sources
23-
uses: actions/checkout@v2
24-
- uses: actions/cache@v2
25-
with:
26-
path: |
27-
~/.gradle/caches
28-
~/.gradle/wrapper
29-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
30-
restore-keys: |
31-
${{ runner.os }}-gradle-
32-
- name: Build and Test ${{ env.PACKAGE_NAME }}
33-
run: |
34-
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
35-
chmod a+x builder.pyz
36-
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
37-
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
22+
- name: Checkout sources
23+
uses: actions/checkout@v2
24+
- uses: actions/cache@v2
25+
with:
26+
path: |
27+
~/.gradle/caches
28+
~/.gradle/wrapper
29+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
30+
restore-keys: |
31+
${{ runner.os }}-gradle-
32+
- name: Build and Test ${{ env.PACKAGE_NAME }}
33+
run: |
34+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
35+
chmod a+x builder.pyz
36+
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
37+
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
3838
3939
macos-compat:
4040
runs-on: macos-latest
4141
steps:
42-
- name: Checkout sources
43-
uses: actions/checkout@v2
44-
- uses: actions/cache@v2
45-
with:
46-
path: |
47-
~/.gradle/caches
48-
~/.gradle/wrapper
49-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
50-
restore-keys: |
51-
${{ runner.os }}-gradle-
52-
- name: Build and Test ${{ env.PACKAGE_NAME }}
53-
env:
54-
CI_USER: ${{ secrets.CI_USER}}
55-
CI_ACCESS_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
56-
run: |
57-
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
58-
chmod a+x builder.pyz
59-
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
60-
GIT_ASKPASS="$(pwd)/.github/scripts/git-ci-askpass.sh" ./builder.pyz build -p ${{ env.PACKAGE_NAME }}
42+
- name: Checkout sources
43+
uses: actions/checkout@v2
44+
- uses: actions/cache@v2
45+
with:
46+
path: |
47+
~/.gradle/caches
48+
~/.gradle/wrapper
49+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
50+
restore-keys: |
51+
${{ runner.os }}-gradle-
52+
- name: Build and Test ${{ env.PACKAGE_NAME }}
53+
run: |
54+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
55+
chmod a+x builder.pyz
56+
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties
57+
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
58+
59+
windows-compat:
60+
runs-on: windows-2019
61+
steps:
62+
- name: Checkout sources
63+
uses: actions/checkout@v2
64+
- uses: actions/setup-java@v2
65+
with:
66+
distribution: 'temurin'
67+
java-version: '11'
68+
cache: 'gradle'
69+
- name: Modify Gradle Daemon JVM Args
70+
# windows job runs out of memory with the defaults normally used
71+
shell: bash
72+
run: |
73+
sed -i 's/org\.gradle\.jvmargs=.*$/org.gradle.jvmargs=-Xmx4g/' gradle.properties
74+
cat gradle.properties
75+
- name: Build and Test ${{ env.PACKAGE_NAME }}
76+
run: |
77+
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
78+
java -version
79+
python3 builder.pyz build -p ${{ env.PACKAGE_NAME }}

aws-runtime/aws-config/common/test/aws/sdk/kotlin/runtime/config/imds/ImdsClientTest.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import aws.smithy.kotlin.runtime.http.HttpStatusCode
1313
import aws.smithy.kotlin.runtime.http.operation.Endpoint
1414
import aws.smithy.kotlin.runtime.http.response.HttpResponse
1515
import aws.smithy.kotlin.runtime.httptest.buildTestConnection
16+
import aws.smithy.kotlin.runtime.testing.IgnoreWindows
1617
import aws.smithy.kotlin.runtime.time.Instant
1718
import aws.smithy.kotlin.runtime.time.ManualClock
1819
import aws.smithy.kotlin.runtime.time.epochMilliseconds
@@ -209,6 +210,7 @@ class ImdsClientTest {
209210
connection.assertRequests()
210211
}
211212

213+
@IgnoreWindows("DNS fails faster on windows and results in a different error")
212214
@Test
213215
fun testHttpConnectTimeouts(): Unit = runSuspendTest {
214216
// end-to-end real client times out after 1-second
@@ -218,14 +220,16 @@ class ImdsClientTest {
218220
}
219221

220222
val start = Instant.now()
221-
assertFails {
223+
val ex = assertFails {
222224
withTimeout(3000) {
223225
client.get("/latest/metadata")
224226
}
225-
}.message.shouldContain("timed out")
227+
}
228+
// on windows DNS fails faster with message `socket connect failure, no route to host.
229+
assertTrue(ex.message!!.contains("timed out"), "message `${ex.message}`")
226230
val elapsed = Instant.now().epochMilliseconds - start.epochMilliseconds
227-
assertTrue(elapsed >= 1000)
228-
assertTrue(elapsed < 2000)
231+
assertTrue(elapsed >= 1000, "expected elapsed ms to be greater than 1000; actual = $elapsed")
232+
assertTrue(elapsed < 2000, "expected elapsed ms to be less than 2000; actual = $elapsed")
229233
}
230234

231235
data class ImdsConfigTest(

aws-runtime/http-client-engine-crt/common/src/aws/sdk/kotlin/runtime/http/engine/crt/SdkStreamResponseHandler.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ internal class SdkStreamResponseHandler(
169169

170170
if (forceClose) {
171171
conn.shutdown()
172+
conn.close()
172173
}
173174
}
174175
}

aws-runtime/http-client-engine-crt/jvm/test/aws/sdk/kotlin/runtime/http/engine/crt/AsyncStressTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import aws.smithy.kotlin.runtime.http.request.url
1414
import aws.smithy.kotlin.runtime.http.response.complete
1515
import aws.smithy.kotlin.runtime.http.sdkHttpClient
1616
import aws.smithy.kotlin.runtime.httptest.TestWithLocalServer
17+
import aws.smithy.kotlin.runtime.testing.IgnoreWindows
1718
import io.ktor.application.*
1819
import io.ktor.response.*
1920
import io.ktor.routing.*
@@ -70,6 +71,7 @@ class AsyncStressTest : TestWithLocalServer() {
7071
}
7172
}
7273

74+
@IgnoreWindows("https://github.com/awslabs/aws-sdk-kotlin/issues/413")
7375
@OptIn(ExperimentalTime::class)
7476
@Test
7577
fun testStreamNotConsumed() = runSuspendTest {

builder.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
"env": {
1313
"JAVA_HOME": "{java_home}"
1414
},
15+
"hosts": {
16+
"windows": {
17+
"!imports": [],
18+
"!env": {}
19+
}
20+
},
1521
"_comment": "prebuild step defined in .builder/actions/set_upstream_versions.py",
1622
"pre_build_steps": [
1723
"set-upstream-versions"

codegen/protocol-tests/build.gradle.kts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,10 @@ open class ProtocolTestTask : DefaultTask() {
163163
if (!generatedBuildDir.exists()) {
164164
throw GradleException("$generatedBuildDir does not exist")
165165
}
166-
val gradlew = project.rootProject.file("gradlew").absolutePath
166+
val wrapper = if (System.getProperty("os.name").toLowerCase().contains("windows")) "gradlew.bat" else "gradlew"
167+
val gradlew = project.rootProject.file(wrapper).absolutePath
167168

168-
// FIXME - this still requires us to publish to maven local.
169-
// We might be able to do something clever with an init script by overriding dependencies or something
170-
// and passing as a cli arg to gradle invocation
171-
// https://docs.gradle.org/current/userguide/init_scripts.html
169+
// NOTE - this still requires us to publish to maven local.
172170
project.exec {
173171
workingDir = generatedBuildDir
174172
executable = gradlew

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ kotlin.mpp.stability.nowarn=true
33
kotlin.native.ignoreDisabledTargets=true
44

55
# gradle
6-
# FIXME - see https://github.com/Kotlin/dokka/issues/1405
76
org.gradle.jvmargs=-Xmx6g -XX:MaxPermSize=6g -XX:MaxMetaspaceSize=1G
87

98
# sdk

0 commit comments

Comments
 (0)