diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 6a07f74..0e41cc5 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -3,10 +3,10 @@ name: Code Quality on: push: {} pull_request: - branches: [main] + branches: [ main ] jobs: - quality: + quality-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ vars.CI_PYTHON_VERSION }} - name: Run pre-commit uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a402ae5..d48dbf8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release Package on: push: tags: - - '[0-9]+.[0-9]+.[0-9]+*' # Matches all valid semver patterns + - '[0-9]+.[0-9]+.[0-9]+*' jobs: release-build: @@ -15,20 +15,20 @@ jobs: fetch-depth: 0 fetch-tags: true - - name: Verify tag is on main branch + - name: Verify current tag is on main branch run: | - # Exit with error if the tag is not on main + # Exit with error if current tag is not on main git merge-base --is-ancestor ${{ github.sha }} origin/main || exit 1 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ vars.CI_PYTHON_VERSION }} - name: Install Poetry uses: abatilo/actions-poetry@v3 with: - poetry-version: 1.8.5 + poetry-version: ${{ vars.CI_POETRY_VERSION }} - name: Install Poetry plugins run: | @@ -57,7 +57,7 @@ jobs: environment: name: pypi - url: https://test.pypi.org/p/ipybox + url: https://pypi.org/project/ipybox/ steps: - name: Retrieve release distributions @@ -69,5 +69,4 @@ jobs: - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ verbose: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3ca14e..b5d8a07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,20 +1,21 @@ -name: Tests +name: Run Tests on: push: {} pull_request: - branches: [main] + branches: [ main ] jobs: test: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - name: Cache conda uses: actions/cache@v4 env: - CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed + CACHE_NUMBER: 0 with: path: ~/conda_pkgs_dir key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} @@ -28,7 +29,7 @@ jobs: - name: Install Poetry uses: abatilo/actions-poetry@v3 with: - poetry-version: 1.8.5 + poetry-version: ${{ vars.CI_POETRY_VERSION }} - name: Install dependencies shell: bash -l {0} diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index ae53588..39a6f85 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -3,7 +3,7 @@ name: Package Installation Tests on: push: {} pull_request: - branches: [main] + branches: [ main ] jobs: build: @@ -18,12 +18,12 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: ${{ vars.CI_PYTHON_VERSION }} - name: Install Poetry uses: abatilo/actions-poetry@v3 with: - poetry-version: 1.8.5 + poetry-version: ${{ vars.CI_POETRY_VERSION }} - name: Install Poetry plugins run: | @@ -40,8 +40,9 @@ jobs: path: dist/ retention-days: 1 - test-install: + test-package: needs: build + strategy: fail-fast: false matrix: @@ -58,7 +59,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Download built package + - name: Download package uses: actions/download-artifact@v4 with: name: dist @@ -98,7 +99,7 @@ jobs: python -c "import ipybox" pip uninstall -y ipybox - - name: Smoke test (Ubuntu) + - name: Run smoke test (Linux) if: runner.os == 'Linux' run: | pip install dist/*.whl