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