diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 14becc5..37ce382 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -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 }} diff --git a/.github/workflows/continuous-release.yml b/.github/workflows/continuous-release.yml deleted file mode 100644 index 98453dc..0000000 --- a/.github/workflows/continuous-release.yml +++ /dev/null @@ -1,61 +0,0 @@ -# continuous-release.yml - -name: Check release - -on: - pull_request_target: - -permissions: - contents: read - -jobs: - check_release: - runs-on: ubuntu-latest - concurrency: release - - permissions: - pull-requests: write - id-token: write - - steps: - - name: Setup | Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 - with: - egress-policy: audit - - - name: Setup | Checkout Repository at workflow sha - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - fetch-depth: 0 - ref: ${{ github.sha }} - - - name: Setup | Force correct release branch on workflow sha - run: | - git checkout -B ${{ github.ref_name }} ${{ github.sha }} - - - name: Action | Semantic Version - id: check - # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@c1bcfdbb994243ac7cf419365d5894d6bfb2950e # v9.12.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - build: false - changelog: true - commit: false - push: false - tag: false - vcs_release: false - - - run: | - echo "## The results of python-semantic-release are below." | tee -a "$GITHUB_STEP_SUMMARY" - echo "* released: ${{ steps.check.outputs.released }}" | tee -a "$GITHUB_STEP_SUMMARY" - echo "* is_prerelease: ${{ steps.check.outputs.is_prerelease }}" | tee -a "$GITHUB_STEP_SUMMARY" - echo "* version: ${{ steps.check.outputs.version }}" | tee -a "$GITHUB_STEP_SUMMARY" - echo "* tag: ${{ steps.check.outputs.tag }}" | tee -a "$GITHUB_STEP_SUMMARY" - - - name: Action | Comment on PR with new version - if: ${{ steps.check.outputs.released == 'true' }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh pr comment ${{ github.event.pull_request.number }} --body "This PR will induce a release as v${{ steps.check.outputs.version }}\n" diff --git a/.github/workflows/continuous-testing.yml b/.github/workflows/continuous-testing.yml index 0be5c1c..3bc1f4a 100644 --- a/.github/workflows/continuous-testing.yml +++ b/.github/workflows/continuous-testing.yml @@ -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 diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest.yml similarity index 85% rename from .github/workflows/pytest-workflow.yml rename to .github/workflows/pytest.yml index 5086476..68e02ac 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest.yml @@ -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 @@ -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: @@ -49,19 +51,19 @@ 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 @@ -69,7 +71,7 @@ jobs: 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: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a351f18..60fc77c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,14 +2,6 @@ name: Build - Publish - Release on: push: - branches: - - 'main' - - 'executable' - paths-ignore: - - '.github/**' - - '!.github/workflows/release.yml' - - 'docs/**' - - 'examples/**' tags: - '*' @@ -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() @@ -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 diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index e626edb..3ee8fd5 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -4,6 +4,7 @@ on: push: branches: - staging + - main permissions: contents: read diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml deleted file mode 100644 index 5190f1d..0000000 --- a/.github/workflows/test-linux.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: '🐧-🐍3.9--3.12' - -on: - push: - tags: - - '*' - branches: - - 'main' - -permissions: - contents: read - -jobs: - full-suite: - strategy: - fail-fast: false - matrix: - version: ["3.9", "3.10", "3.11", "3.12"] - uses: sandialabs/sansmic/.github/workflows/pytest-workflow.yml@7952e59342a8c8d1c8ad833121049bac58277167 - with: - version: ${{ matrix.version }} - os: ubuntu-latest - secrets: - coverage_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test-macOS_arm.yml b/.github/workflows/test-macOS_arm.yml deleted file mode 100644 index acd5f31..0000000 --- a/.github/workflows/test-macOS_arm.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: '🍎-🐍3.9--3.12' - -on: - push: - tags: - - '*' - branches: - - 'main' - -permissions: - contents: read - -jobs: - full-suite: - strategy: - fail-fast: false - matrix: - version: ["3.9", "3.10", "3.11", "3.12"] - uses: sandialabs/sansmic/.github/workflows/pytest-workflow.yml@7952e59342a8c8d1c8ad833121049bac58277167 - with: - version: ${{ matrix.version }} - os: macOS-latest - secrets: - coverage_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test-macOS_intel.yml b/.github/workflows/test-macOS_intel.yml deleted file mode 100644 index 43a111a..0000000 --- a/.github/workflows/test-macOS_intel.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: '🍏-🐍3.9--3.12' - -on: - push: - tags: - - '*' - branches: - - 'main' - -permissions: - contents: read - -jobs: - full-suite: - strategy: - fail-fast: false - matrix: - version: ["3.9", "3.10", "3.11", "3.12"] - uses: sandialabs/sansmic/.github/workflows/pytest-workflow.yml@7952e59342a8c8d1c8ad833121049bac58277167 - with: - version: ${{ matrix.version }} - os: macOS-13 - secrets: - coverage_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml deleted file mode 100644 index 3cba306..0000000 --- a/.github/workflows/test-windows.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: '🏢-🐍3.9--3.12' - -on: - push: - tags: - - '*' - branches: - - 'main' - -permissions: - contents: read - -jobs: - full-suite: - strategy: - fail-fast: false - matrix: - version: ["3.9", "3.10", "3.11", "3.12"] - uses: sandialabs/sansmic/.github/workflows/pytest-workflow.yml@7952e59342a8c8d1c8ad833121049bac58277167 - with: - version: ${{ matrix.version }} - os: windows-latest - secrets: - coverage_token: ${{ secrets.CODECOV_TOKEN }}