Skip to content

Commit

Permalink
updated GH actions to use pdm
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <[email protected]>
  • Loading branch information
Lawouach committed Feb 23, 2024
1 parent 8fe6ca7 commit 817b3a3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 80 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/build-and-discover.yaml

This file was deleted.

56 changes: 28 additions & 28 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Build, Test, and Lint
name: Build

on:
pull_request:
branches:
- master
push:
branches:
- master
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
make install-dev
- name: Run linting
run: |
make lint
build-and-test:
runs-on: ubuntu-22.04
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "macos-latest"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
fetch-depth: 0

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
prerelease: true

- name: Ensure lock file is up to date
run: |
pdm lock --check
- name: Install dependencies
run: |
make install-dev
- name: Run tests
pdm sync -d
- name: Run Lint
run: |
pdm run lint
- name: Run Tests
run: |
make tests
pdm run pytest
33 changes: 14 additions & 19 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Release

on:
pull_request:
branches-ignore:
- 'master'
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
Expand All @@ -10,28 +13,20 @@ jobs:
release-to-pypi:
runs-on: ubuntu-22.04
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel twine
- name: Build and publish
cache: true
- name: Build
run: pdm build
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
run: |
python3 setup.py release
twine upload dist/*
- name: Upload packages as artifacts
uses: actions/upload-artifact@v2-preview
with:
name: chaostoolkit-aws-packages
path: dist/chaostoolkit_aws-*
PDM_BUILD_SCM_VERSION: ${{github.ref_name}}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

create-gh-release:
runs-on: ubuntu-22.04
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- Switched tp [pdm](https://pdm-project.org/latest/) away from `setuptools` to
manage the package. This will offer a more cohesive experience and will
handle dependencies more strictly
- Drop Python 3.7 support as it has been EOL since June 2023
- Updated GH actions to use PDM and the trusted publisher workflow from Pypi

## [0.31.1][] - 2024-01-22

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension to the [Chaos Toolkit][chaostoolkit].

## Install

This package requires Python 3.6+
This package requires Python 3.8+

To be used from your experiment, this package must be installed in the Python
environment where [chaostoolkit][] already lives.
Expand Down

0 comments on commit 817b3a3

Please sign in to comment.