Skip to content

Commit

Permalink
ci: clean up continuous integration workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhart committed Oct 31, 2024
1 parent a195057 commit b3872a8
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 190 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
version: ["3.9", "3.10", "3.11", "3.12"]
os: [windows-latest, macOS-13, macOS-latest, ubuntu-latest]
uses: sandialabs/sansmic/.github/workflows/pytest-workflow.yml@7952e59342a8c8d1c8ad833121049bac58277167
uses: ./.github/workflows/pytest.yaml
with:
version: ${{ matrix.version }}
os: ${{ matrix.os }}
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/continuous-release.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .github/workflows/continuous-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ on:
- setup.py
- pyproject.toml
- .github/workflows/*
branches:
- '!main'
- '!staging'
pull_request:
branches:
- '!main'
- '!staging'

permissions:
contents: read

jobs:
quick-test:
uses: dbhart/sansmic-workflows/.github/workflows/pytest.yaml@main
uses: ./.github/workflows/pytest.yaml
with:
verbose: true
secrets:
coverage_token: ${{ secrets.CODECOV_TOKEN }}

check-release:
uses: dbhart/sansmic-workflows/.github/workflows/release.yaml@main
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Reusable test workflow
name: Use pytest to run tests

on:
workflow_call:
inputs:
version:
required: true
required: false
default: '3.12'
type: string
os:
required: true
required: false
default: 'ubuntu-latest'
type: string
verbose:
default: false
Expand All @@ -22,9 +24,9 @@ permissions:

jobs:
run-pytest-coverage:
name: Test and compute coverage
name: pytest and coverarge
runs-on: ${{ inputs.os }}
steps:
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
Expand All @@ -49,27 +51,27 @@ jobs:
with:
python-version: ${{ inputs.version }}

- name: Install testing dependencies
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
- name: Test build and install
run: python3 -m pip install .[formats,examples,tests]
- name: Build test
run: python3 -m pip install -e .[formats,examples,tests]

- name: Test with pytest
- name: Test with pytest (quiet)
if: ${{ ! inputs.verbose }}
run: |
python3 -m pytest --nbmake --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/
- name: Test with pytest (non-windows verbose)
- name: Test with pytest (non-windows, verbose)
if: inputs.verbose && inputs.os != 'windows-latest'
run: |
echo '### Run tests' >> $GITHUB_STEP_SUMMARY
echo '```bash' >> $GITHUB_STEP_SUMMARY
python3 -m pytest --nbmake --disable-warnings --cov=sansmic --cov=tests --no-header --color=auto examples/ tests/ | tee -a $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Test with pytest (windows verbose)
- name: Test with pytest (windows, verbose)
if: inputs.verbose && inputs.os == 'windows-latest'
shell: powershell
run: |
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ name: Build - Publish - Release

on:
push:
branches:
- 'main'
- 'executable'
paths-ignore:
- '.github/**'
- '!.github/workflows/release.yml'
- 'docs/**'
- 'examples/**'
tags:
- '*'

Expand Down Expand Up @@ -202,14 +194,14 @@ jobs:
./dist/*.tar.gz
./dist/*.whl
- name: Action | Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
# - name: Action | Create GitHub Release
# env:
# GITHUB_TOKEN: ${{ github.token }}
# run: >-
# gh release create
# '${{ github.ref_name }}'
# --repo '${{ github.repository }}'
# --notes ""

- name: Action | Upload artifact signatures to GitHub Release
if: success() || failure()
Expand Down Expand Up @@ -242,7 +234,8 @@ jobs:
- name: Zip up dist directory
run: |
cd dist
zip ../sansmic-${{ env.sansmic_version }}-standalone-win_amd64.zip *
zip -r ../sansmic-${{ env.sansmic_version }}-standalone-win_amd64.zip *
cd ..
- name: Action | Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- staging
- main

permissions:
contents: read
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/test-linux.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/test-macOS_arm.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/test-macOS_intel.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/test-windows.yml

This file was deleted.

0 comments on commit b3872a8

Please sign in to comment.