Merge pull request #274 from smithy-lang/dependabot/pip/python-aeb088… #1020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |