boto3-stubs consistency #225
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: boto3-stubs consistency | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
inputs: | |
boto3_version: | |
description: Target boto3 version | |
required: false | |
jobs: | |
versions: | |
runs-on: ubuntu-latest | |
outputs: | |
boto3: ${{ steps.boto3.outputs.result }} | |
botocore: ${{ steps.botocore.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Extract boto3 version | |
id: boto3 | |
uses: actions/github-script@v7 | |
with: | |
result-encoding: string | |
script: | | |
const { getBoto3Version, setupGlobals } = require('./.github/workflows/helpers.js') | |
setupGlobals({ core, context, fetch }) | |
const inputBoto3Version = context.payload.inputs && context.payload.inputs.boto3_version | |
const version = inputBoto3Version ? inputBoto3Version : await getBoto3Version() | |
core.notice(`boto3 version ${version}`) | |
return version | |
- name: Extract botocore version | |
id: botocore | |
uses: actions/github-script@v7 | |
env: | |
BOTO3_VERSION: ${{ steps.boto3.outputs.result }} | |
with: | |
result-encoding: string | |
script: | | |
const { getBotocoreVersion } = require('./.github/workflows/helpers.js') | |
const version = getBotocoreVersion(process.env.BOTO3_VERSION) | |
core.notice(`botocore version ${version}`) | |
return version | |
check-stubs: | |
runs-on: ubuntu-latest | |
needs: versions | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: pyproject.toml | |
- name: Install dependencies | |
run: | | |
poetry install -n | |
- name: Install boto3 | |
env: | |
BOTO3_VERSION: ${{ needs.versions.outputs.boto3 }} | |
BOTOCORE_VERSION: ${{ needs.versions.outputs.botocore }} | |
run: | | |
poetry run pip install -U boto3==${BOTO3_VERSION} botocore==${BOTOCORE_VERSION} | |
poetry run pip install -U botocore-stubs | |
- name: Uninstall stubs | |
run: | | |
poetry run pip uninstall -y boto3-stubs | |
- name: Check boto3 stubs | |
run: | | |
poetry run istub -c ./istub.yml -bid boto3 |