Add more logging #353
Workflow file for this run
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: | |
pull_request: | |
release: | |
types: | |
- published | |
env: | |
PYTHON_VERSION: '3.12' | |
concurrency: | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
precommit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install pre-commit | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pre-commit virtualenv!=20.0.6 | |
pre-commit install | |
- name: Run static code inspections | |
run: pre-commit run --all-files | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ env.PYTHON_VERSION }} | |
# deadsnakes python required due to https://github.com/JonathonReinhart/staticx/issues/188 | |
uses: deadsnakes/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Build the binary | |
run: | | |
poetry install | |
poetry run make -C dist clean | |
- name: Run pytest | |
run: poetry run pytest | |
deploy: | |
if: github.event_name == 'release' | |
needs: [precommit, build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python ${{ env.PYTHON_VERSION }} | |
# deadsnakes python required due to https://github.com/JonathonReinhart/staticx/issues/188 | |
uses: deadsnakes/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Build the binary | |
run: | | |
poetry install | |
poetry run make -C dist clean | |
poetry run make -C dist release | |
- name: Upload to release | |
run: | | |
gh release upload ${{ github.ref_name }} "dist/sagemaker-shim-`poetry run python -c "from importlib.metadata import version;print(version('sagemaker-shim'))"`-`uname -s`-`uname -i`.tar.gz" "dist/checksums.txt" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload to pypi | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }} | |
run: | | |
poetry publish --build |