251 [davidbrownell] on main #251
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: "Standard" | |
run-name: ${{ github.run_number }} [${{ github.actor }}] on ${{ github.ref_name }} | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' # Once a day at 12am UTC | |
workflow_dispatch: | |
jobs: | |
# ---------------------------------------------------------------------- | |
validate: | |
name: Validate | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: | |
- "3.12" | |
- "3.11" | |
- "3.10" | |
env: | |
COLUMNS: "200" | |
SIMULATE_TERMINAL_CAPABILITIES_SUPPORTS_COLORS: "1" | |
PYTHONIOENCODING: "UTF-8" | |
permissions: {} | |
steps: | |
- name: "Checkout Source" | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Initialize | |
id: Initialize | |
uses: davidbrownell/dbrownell_DevTools/.github/actions/initialize@CI-v0.23.0 | |
with: | |
operating_system: ubuntu-latest | |
- name: Bootstrap | |
shell: bash | |
run: | | |
./Bootstrap.sh --python-version ${{ matrix.python_version }} | |
- name: Black | |
shell: bash | |
run: | | |
. ./Activate.sh | |
python Build.py black --verbose | |
- name: Pytest | |
shell: bash | |
run: | | |
. ./Activate.sh | |
python Build.py pytest --verbose | |
# ---------------------------------------------------------------------- | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: validate | |
permissions: | |
contents: write # To tag the repository | |
steps: | |
- name: "Checkout Source" | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Has Release Changes? | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: dorny/paths-filter@v3 | |
id: has_release_changes | |
with: | |
filters: .github/release_sources.yaml | |
- name: Publish | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.has_release_changes.outputs.src == 'true' }} | |
uses: ./.github/actions/publish_impl |