|
1 | 1 | name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - develop |
7 | 4 | pull_request: |
8 | 5 | branches: |
9 | 6 | - develop |
10 | 7 |
|
11 | 8 | jobs: |
12 | | - test: |
13 | | - runs-on: ubuntu-latest |
14 | | - |
15 | | - strategy: |
16 | | - fail-fast: false |
17 | | - matrix: |
18 | | - python-version: ["3.12"] |
19 | | - |
20 | | - steps: |
21 | | - - name: Checkout Repository |
22 | | - uses: actions/checkout@v4 |
23 | | - |
24 | | - - name: Set up Python for CI - ${{ matrix.python-version }} |
25 | | - uses: actions/setup-python@v5 |
26 | | - with: |
27 | | - python-version: ${{ matrix.python-version }} |
28 | | - |
29 | | - - name: Initialize Pants |
30 | | - uses: pantsbuild/actions/init-pants@main |
31 | | - with: |
32 | | - # cache0 makes it easy to bust the cache if needed |
33 | | - # just increase the integer to start with a fresh cache |
34 | | - gha-cache-key: cache0-py${{ matrix.python_version }} |
35 | | - named-caches-hash: ${{ hashFiles('python-default.lock') }} |
36 | | - pants-ci-config: pants.ci.toml |
37 | | - |
38 | | - - name: Run tests |
39 | | - run: | |
40 | | - make test-py |
41 | | -
|
42 | | - - name: Upload coverage |
43 | | - if: matrix.python-version == 3.12 |
44 | | - uses: codecov/codecov-action@v3 |
45 | | - with: |
46 | | - token: ${{ secrets.CODECOV_TOKEN }} |
47 | | - file: ./dist/coverage/python/coverage.xml |
48 | | - flags: unittests |
49 | | - name: codecov-umbrella |
50 | | - fail_ci_if_error: true |
51 | | - |
52 | | - |
53 | | - test-codegen: |
| 9 | + ci: |
54 | 10 | runs-on: ubuntu-latest |
55 | | - |
56 | | - strategy: |
57 | | - fail-fast: false |
58 | | - matrix: |
59 | | - python-version: ["3.12"] |
60 | | - |
61 | | - name: Codegen Java 17 / Python ${{ matrix.python-version }} |
62 | | - |
63 | 11 | steps: |
64 | 12 | - name: Checkout Repository |
65 | 13 | uses: actions/checkout@v4 |
66 | 14 |
|
67 | | - - name: Download Corretto 17 JDK |
68 | | - run: | |
69 | | - download_url="https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz" |
70 | | - wget -O $RUNNER_TEMP/java_package.tar.gz $download_url |
71 | | -
|
72 | | - - name: Set up Corretto 17 JDK |
| 15 | + - name: Set up JDK 17 |
73 | 16 | uses: actions/setup-java@v4 |
74 | 17 | with: |
75 | | - distribution: 'jdkfile' |
76 | | - jdkFile: ${{ runner.temp }}/java_package.tar.gz |
77 | 18 | java-version: 17 |
78 | | - architecture: x64 |
| 19 | + distribution: 'corretto' |
79 | 20 |
|
80 | | - - name: clean and build without python |
81 | | - run: cd codegen && ./gradlew clean build |
| 21 | + - name: Install uv |
| 22 | + uses: astral-sh/setup-uv@v5 |
82 | 23 |
|
83 | | - - name: Set Up Python for CI - ${{ matrix.python-version }} |
84 | | - uses: actions/setup-python@v5 |
85 | | - with: |
86 | | - python-version: ${{ matrix.python-version }} |
87 | | - |
88 | | - - name: Initialize Pants |
89 | | - uses: pantsbuild/actions/init-pants@main |
90 | | - with: |
91 | | - # cache0 makes it easy to bust the cache if needed |
92 | | - gha-cache-key: cache0-py${{ matrix.python_version }} |
93 | | - named-caches-hash: ${{ hashFiles('python-default.lock') }} |
94 | | - pants-ci-config: pants.ci.toml |
95 | | - |
96 | | - - name: Install smithy-python |
| 24 | + - name: Setup workspace |
97 | 25 | run: | |
98 | | - make install-python-components |
| 26 | + make install |
99 | 27 |
|
100 | | - - name: clean and build without formatting/linting installed |
101 | | - run: cd codegen && ./gradlew clean build |
| 28 | + - name: Check python packages |
| 29 | + run: | |
| 30 | + make check-py |
102 | 31 |
|
103 | | - - name: Install black |
| 32 | + - name: Test python packages |
104 | 33 | run: | |
105 | | - python${{ matrix.python-version }} -m pip install --upgrade black |
| 34 | + make test-py |
106 | 35 |
|
107 | | - - name: clean and build without linting installed |
108 | | - run: cd codegen && ./gradlew clean build |
| 36 | + - name: Build python packages |
| 37 | + run: | |
| 38 | + make build-py |
109 | 39 |
|
110 | | - - name: Install mypy and other libraries necessary for typing |
| 40 | + - name: Build (and test) java packages |
111 | 41 | run: | |
112 | | - python${{ matrix.python-version }} -m pip install --upgrade mypy pytest pytest-asyncio |
| 42 | + make build-java |
113 | 43 |
|
114 | | - - name: clean and build with all optional tools installed |
115 | | - run: cd codegen && ./gradlew clean build |
| 44 | + - name: Run protocol tests |
| 45 | + run: | |
| 46 | + make test-protocols |
0 commit comments