2
2
name : Library Java tests
3
3
4
4
on :
5
- pull_request :
6
- push :
7
- branches :
8
- - public-v4
9
- schedule :
10
- # Nightly build against Dafny's nightly prereleases,
11
- # for early warning of verification issues or regressions.
12
- # Timing chosen to be adequately after Dafny's own nightly build,
13
- # but this might need to be tweaked:
14
- # https://github.com/dafny-lang/dafny/blob/master/.github/workflows/deep-tests.yml#L16
15
- - cron : " 30 16 * * *"
5
+ workflow_call :
6
+ inputs :
7
+ dafny :
8
+ description : ' The Dafny version to run'
9
+ required : true
10
+ type : string
16
11
17
12
jobs :
18
13
testJava :
19
- # Don't run the nightly build on forks
20
- if : github.event_name != 'schedule' || github.repository_owner == 'aws'
21
14
strategy :
22
15
matrix :
23
16
library : [
@@ -30,41 +23,31 @@ jobs:
30
23
macos-latest
31
24
]
32
25
runs-on : ${{ matrix.os }}
33
- environment : " MPL_DAFNY"
34
26
permissions :
35
27
id-token : write
36
28
contents : read
37
29
steps :
38
- - uses : actions/checkout@v2
30
+ - name : Support longpaths
31
+ run : |
32
+ git config --global core.longpaths true
33
+
34
+ - uses : actions/checkout@v3
39
35
- name : Init Submodules
40
- env :
41
- # This secret is in the configured environment
42
- # Token created on # 09/26/2023
43
- # expires in ~30 days 10/26/2023
44
- MPL_PAT : ${{ secrets.MPL_DAFNY }}
45
36
run : |
46
- AUTH="$(echo -n "pat:${MPL_PAT}" | base64 | tr -d '\n')"
47
- git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $AUTH"
48
- git config --global --add url.https://github.com/.insteadOf [email protected] :
49
37
git submodule update --init libraries
50
38
git submodule update --init --recursive mpl
51
39
52
- - name : Support longpaths
53
- run : |
54
- git config --global core.longpaths true
55
40
- name : Configure AWS Credentials
56
- uses : aws-actions/configure-aws-credentials@v1
41
+ uses : aws-actions/configure-aws-credentials@v2
57
42
with :
58
43
aws-region : us-west-2
59
- # TODO: This role was manually created.
60
- role-to-assume : arn:aws:iam::370957321024:role/ESDK-Dafny-Private-CA-Read
61
- role-session-name : JavaPrivateESDKDafnyTests
44
+ role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
45
+ role-session-name : JavaTests
62
46
63
47
- name : Setup Dafny
64
48
uses :
dafny-lang/[email protected]
65
49
with :
66
- # A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
67
- dafny-version : ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
50
+ dafny-version : ${{ inputs.dafny }}
68
51
69
52
- name : Setup Java 8
70
53
uses : actions/setup-java@v3
80
63
CORES=$(node -e 'console.log(os.cpus().length)')
81
64
make build_java CORES=$CORES
82
65
83
- # KMS and MPL tests need to use credentials which can call KMS
84
- - name : Configure AWS Credentials for Tests
85
- uses : aws-actions/configure-aws-credentials@v1
86
- if : matrix.library == 'ComAmazonawsKms' || matrix.library == 'AwsCryptographicMaterialProviders' || matrix.library == 'TestVectorsAwsCryptographicMaterialProviders'
87
- with :
88
- aws-region : us-west-2
89
- role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-ESDK-Dafny-Role-us-west-2
90
- role-session-name : JavaTests
91
-
92
66
- name : Test ${{ matrix.library }}
93
67
working-directory : ./${{ matrix.library }}
94
- # TODO: DDB currently has no tests
95
- if : matrix.library != 'ComAmazonawsDynamodb'
96
68
run : |
97
69
make test_java
98
70
0 commit comments