Skip to content

Commit 511ed35

Browse files
author
Shubham Chaturvedi
committed
feat: Adds CI
1 parent 1a586b4 commit 511ed35

File tree

9 files changed

+121
-2
lines changed

9 files changed

+121
-2
lines changed

.github/actions/polymorph_codegen/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ runs:
8888
run: |
8989
make polymorph_python
9090
91+
- name: Regenerate Go code using smithy-dafny
92+
working-directory: ./${{ inputs.library }}
93+
shell: bash
94+
run: |
95+
make polymorph_go
96+
9197
- name: Check regenerated code against commited code
9298
# Composite action inputs seem to not actually support booleans properly for some reason
9399
if: inputs.diff-generated-code == 'true'

.github/workflows/daily_ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
uses: ./.github/workflows/library_python_tests.yml
5656
with:
5757
dafny: ${{needs.getVersion.outputs.version}}
58+
daily-ci-go:
59+
needs: getVersion
60+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
61+
uses: ./.github/workflows/library_go_tests.yml
62+
with:
63+
dafny: ${{needs.getVersion.outputs.version}}
5864
daily-interop-test:
5965
needs: getVersion
6066
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# This workflow performs tests in Go.
2+
name: Library Go tests
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
9+
required: true
10+
type: string
11+
regenerate-code:
12+
description: "Regenerate code using smithy-dafny"
13+
required: false
14+
default: false
15+
type: boolean
16+
17+
jobs:
18+
testGo:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
library:
23+
[
24+
StandardLibrary,
25+
]
26+
go-version: ["1.23"]
27+
os: [
28+
# TODO fix Dafny-generated tests on Windows;
29+
# the sys.path workaround for generated Dafny doesn't work on Windows.
30+
# Note: only tests use the sys.path workaround, not source code.
31+
# Windows source code is tested downstream (ex. ESDK-Python CI).
32+
# windows-latest,
33+
ubuntu-latest,
34+
macos-13,
35+
]
36+
runs-on: ${{ matrix.os }}
37+
defaults:
38+
run:
39+
shell: bash
40+
permissions:
41+
id-token: write
42+
contents: read
43+
steps:
44+
- name: Support longpaths on Git checkout
45+
run: |
46+
git config --global core.longpaths true
47+
48+
- name: Configure AWS Credentials
49+
uses: aws-actions/configure-aws-credentials@v4
50+
with:
51+
aws-region: us-west-2
52+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
53+
role-session-name: GoTests
54+
55+
- uses: actions/checkout@v4
56+
# The specification submodule is private so we don't have access, but we don't need
57+
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
58+
- run: git submodule update --init libraries
59+
- run: git submodule update --init smithy-dafny
60+
61+
- name: Setup Dafny
62+
uses: dafny-lang/[email protected]
63+
with:
64+
dafny-version: ${{ inputs.dafny }}
65+
66+
- name: Install Go
67+
uses: actions/setup-go@v2
68+
with:
69+
go-version: ${{ matrix.go-version }}
70+
71+
- name: Install Go imports
72+
run: |
73+
go install golang.org/x/tools/cmd/goimports@latest
74+
75+
- name: Build ${{ matrix.library }} implementation
76+
working-directory: ./${{ matrix.library }}
77+
run: |
78+
# This works because `node` is installed by default on GHA runners
79+
CORES=$(node -e 'console.log(os.cpus().length)')
80+
make transpile_go CORES=$CORES
81+
82+
- name: Test ${{ matrix.library }}
83+
working-directory: ./${{ matrix.library }}
84+
shell: bash
85+
run: |
86+
make test_go

.github/workflows/manual.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ jobs:
4747
with:
4848
dafny: ${{needs.getVersion.outputs.version}}
4949
regenerate-code: ${{ inputs.regenerate-code }}
50+
manual-ci-go:
51+
uses: ./.github/workflows/library_go_tests.yml
52+
with:
53+
dafny: ${{needs.getVersion.outputs.version}}
54+
regenerate-code: ${{ inputs.regenerate-code }}
5055
manual-interop-test:
5156
uses: ./.github/workflows/library_interop_tests.yml
5257
with:

.github/workflows/nightly_dafny.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ jobs:
5353
uses: ./.github/workflows/library_python_tests.yml
5454
with:
5555
dafny: ${{needs.getVersion.outputs.version}}
56+
dafny-nightly-go:
57+
needs: getVersion
58+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
59+
uses: ./.github/workflows/library_go_tests.yml
60+
with:
61+
dafny: ${{needs.getVersion.outputs.version}}
5662

5763
cut-issue-on-failure:
5864
runs-on: ubuntu-latest

.github/workflows/pull.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
uses: ./.github/workflows/library_python_tests.yml
4545
with:
4646
dafny: ${{needs.getVersion.outputs.version}}
47+
pr-ci-go:
48+
needs: getVersion
49+
uses: ./.github/workflows/library_go_tests.yml
50+
with:
51+
dafny: ${{needs.getVersion.outputs.version}}
4752
pr-interop-test:
4853
needs: getVersion
4954
uses: ./.github/workflows/library_interop_tests.yml

.github/workflows/push.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
uses: ./.github/workflows/library_python_tests.yml
4747
with:
4848
dafny: ${{needs.getVersion.outputs.version}}
49+
push-ci-go:
50+
needs: getVersion
51+
uses: ./.github/workflows/library_go_tests.yml
52+
with:
53+
dafny: ${{needs.getVersion.outputs.version}}
4954
pr-interop-test:
5055
needs: getVersion
5156
uses: ./.github/workflows/library_interop_tests.yml

smithy-dafny

Submodule smithy-dafny updated 125 files

0 commit comments

Comments
 (0)