Skip to content

Commit ff823ac

Browse files
test: restore CODEOWNERS and daily CI (#624)
Co-authored-by: José Corella <[email protected]>
1 parent 2b07a39 commit ff823ac

8 files changed

+130
-86
lines changed

.github/CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Each line is a file pattern followed by one or more owners.
2+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
3+
4+
# Default code owner for everything is our aws-crypto-tools group
5+
* @aws/aws-crypto-tools

.github/workflows/daily_ci.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow runs every weekday at 15:00 UTC (8AM PDT)
2+
name: Daily CI
3+
4+
on:
5+
schedule:
6+
- cron: "00 15 * * 1-5"
7+
8+
jobs:
9+
daily-ci-verification:
10+
# Don't run the cron builds on forks
11+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
12+
uses: ./.github/workflows/library_dafny_verification.yml
13+
with:
14+
dafny: '4.2.0'
15+
# daily-ci-java:
16+
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
17+
# uses: ./.github/workflows/library_java_tests.yml
18+
# with:
19+
# dafny: '4.2.0'
20+
daily-ci-net:
21+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
22+
uses: ./.github/workflows/library_net_tests.yml
23+
with:
24+
dafny: '4.2.0'

.github/workflows/library_dafny_verification.yml

+10-28
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,40 @@
22
name: Library Dafny verification
33

44
on:
5-
pull_request:
6-
push:
7-
branches:
8-
- public-v4
9-
workflow_dispatch:
10-
# Manual trigger for this workflow, either the normal version
11-
# or the nightly build that uses the latest Dafny prerelease
12-
# (accordingly to the "nightly" parameter).
5+
workflow_call:
136
inputs:
14-
nightly:
15-
description: 'Run the nightly build'
16-
required: false
17-
type: boolean
18-
schedule:
19-
# Nightly build against Dafny's nightly prereleases,
20-
# for early warning of verification issues or regressions.
21-
# Timing chosen to be adequately after Dafny's own nightly build,
22-
# but this might need to be tweaked:
23-
# https://github.com/dafny-lang/dafny/blob/master/.github/workflows/deep-tests.yml#L16
24-
- cron: "30 16 * * *"
7+
dafny:
8+
description: 'The Dafny version to run'
9+
required: true
10+
type: string
2511

2612
jobs:
2713
verification:
28-
# Don't run the nightly build on forks
29-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
3014
strategy:
3115
matrix:
3216
library: [
3317
AwsEncryptionSDK
3418
]
3519
os: [ macos-latest ]
3620
runs-on: ${{ matrix.os }}
37-
environment: "MPL_DAFNY"
3821
env:
3922
DOTNET_CLI_TELEMETRY_OPTOUT: 1
4023
DOTNET_NOLOGO: 1
4124
steps:
25+
- name: Support longpaths
26+
run: |
27+
git config --global core.longpaths true
28+
4229
- uses: actions/checkout@v2
4330
- name: Init Submodules
4431
run: |
4532
git submodule update --init libraries
4633
git submodule update --init --recursive mpl
4734
48-
- name: Support longpaths
49-
run: |
50-
git config --global core.longpaths true
51-
5235
- name: Setup Dafny
5336
uses: dafny-lang/[email protected]
5437
with:
55-
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
56-
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
38+
dafny-version: ${{ inputs.dafny }}
5739

5840
- name: Verify ${{ matrix.library }} Dafny code
5941
shell: bash

.github/workflows/library_java_tests.yml

+15-43
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,15 @@
22
name: Library Java tests
33

44
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
1611

1712
jobs:
1813
testJava:
19-
# Don't run the nightly build on forks
20-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
2114
strategy:
2215
matrix:
2316
library: [
@@ -30,41 +23,31 @@ jobs:
3023
macos-latest
3124
]
3225
runs-on: ${{ matrix.os }}
33-
environment: "MPL_DAFNY"
3426
permissions:
3527
id-token: write
3628
contents: read
3729
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
3935
- 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 }}
4536
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]:
4937
git submodule update --init libraries
5038
git submodule update --init --recursive mpl
5139
52-
- name: Support longpaths
53-
run: |
54-
git config --global core.longpaths true
5540
- name: Configure AWS Credentials
56-
uses: aws-actions/configure-aws-credentials@v1
41+
uses: aws-actions/configure-aws-credentials@v2
5742
with:
5843
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
6246

6347
- name: Setup Dafny
6448
uses: dafny-lang/[email protected]
6549
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 }}
6851

6952
- name: Setup Java 8
7053
uses: actions/setup-java@v3
@@ -80,19 +63,8 @@ jobs:
8063
CORES=$(node -e 'console.log(os.cpus().length)')
8164
make build_java CORES=$CORES
8265
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-
9266
- name: Test ${{ matrix.library }}
9367
working-directory: ./${{ matrix.library }}
94-
# TODO: DDB currently has no tests
95-
if: matrix.library != 'ComAmazonawsDynamodb'
9668
run: |
9769
make test_java
9870

.github/workflows/library_net_tests.yml

+7-15
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,12 @@
22
name: Library net tests
33

44
on:
5-
pull_request:
6-
push:
7-
branches:
8-
- mainline
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
1611

1712
env:
1813
# Used in examples
@@ -27,8 +22,6 @@ env:
2722

2823
jobs:
2924
testDotNet:
30-
# Don't run the nightly build on forks
31-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
3225
strategy:
3326
matrix:
3427
os: [
@@ -69,8 +62,7 @@ jobs:
6962
- name: Setup Dafny
7063
uses: dafny-lang/[email protected]
7164
with:
72-
# A && B || C is the closest thing to an if .. then ... else ... or ?: expression the GitHub Actions syntax supports.
73-
dafny-version: ${{ (github.event_name == 'schedule' || inputs.nightly) && 'nightly-latest' || '4.2.0' }}
65+
dafny-version: ${{ inputs.dafny }}
7466

7567
- name: Download Dependencies
7668
working-directory: ./AwsEncryptionSDK

.github/workflows/nighly_dafny.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow invokes other workflows with the nightly Dafny build
2+
name: Dafny Nightly
3+
4+
on:
5+
schedule:
6+
# Nightly build against Dafny's nightly prereleases,
7+
# for early warning of verification issues or regressions.
8+
# Timing chosen to be adequately after Dafny's own nightly build,
9+
# but this might need to be tweaked:
10+
# https://github.com/dafny-lang/dafny/blob/master/.github/workflows/deep-tests.yml#L16
11+
- cron: "30 16 * * *"
12+
13+
jobs:
14+
dafny-nightly-verification:
15+
# Don't run the cron builds on forks
16+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
17+
uses: ./.github/workflows/library_dafny_verification.yml
18+
with:
19+
dafny: 'nightly-latest'
20+
# dafny-nightly-java:
21+
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
22+
# uses: ./.github/workflows/library_java_tests.yml
23+
# with:
24+
# dafny: 'nightly-latest'
25+
dafny-nightly-net:
26+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
27+
uses: ./.github/workflows/library_net_tests.yml
28+
with:
29+
dafny: 'nightly-latest'

.github/workflows/pull.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This workflow runs for every pull request
2+
name: PR CI
3+
4+
on:
5+
pull_request:
6+
7+
jobs:
8+
pr-ci-verification:
9+
uses: ./.github/workflows/library_dafny_verification.yml
10+
with:
11+
dafny: '4.2.0'
12+
# pr-ci-java:
13+
# uses: ./.github/workflows/library_java_tests.yml
14+
# with:
15+
# dafny: '4.2.0'
16+
pr-ci-net:
17+
uses: ./.github/workflows/library_net_tests.yml
18+
with:
19+
dafny: '4.2.0'

.github/workflows/push.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This workflow runs for every push to main
2+
name: Push CI
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
push-ci-verification:
11+
uses: ./.github/workflows/library_dafny_verification.yml
12+
with:
13+
dafny: '4.2.0'
14+
# push-ci-java:
15+
# uses: ./.github/workflows/library_java_tests.yml
16+
# with:
17+
# dafny: '4.2.0'
18+
push-ci-net:
19+
uses: ./.github/workflows/library_net_tests.yml
20+
with:
21+
dafny: '4.2.0'

0 commit comments

Comments
 (0)