File: ci.yml

package info (click to toggle)
python-semantic-release 10.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,236 kB
  • sloc: python: 36,523; sh: 340; makefile: 156
file content (101 lines) | stat: -rw-r--r-- 4,428 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
    branches: # Target branches
      - master

# default token permissions = none
permissions: {}

# If a new push is made to the branch, cancel the previous run
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:

  commitlint:
    # condition: Execute IFF it is protected branch update, or a PR that is NOT in a draft state
    if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: wagoid/commitlint-github-action@b948419dd99f3fd78a6548d48f94e3df7f6bf3ed  # v6.2.1


  eval-changes:
    name: Evaluate changes
    # condition: Execute IFF it is protected branch update, or a PR that is NOT in a draft state
    if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 100

      - name: Evaluate | Check common file types for changes
        id: core-changed-files
        uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c  #v46.0.5
        with:
          files_yaml_from_source_file: .github/changed-files-spec.yml

      - name: Evaluate | Check specific file types for changes
        id: ci-changed-files
        uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c  #v46.0.5
        with:
          files_yaml: |
            ci:
              - .github/workflows/ci.yml
              - .github/workflows/validate.yml

      - name: Evaluate | Detect if any of the combinations of file sets have changed
        id: all-changes
        run: |
          printf '%s\n' "any_changed=false" >> $GITHUB_OUTPUT
          if [ "${{ steps.core-changed-files.outputs.build_any_changed }}" == "true" ] || \
             [ "${{ steps.ci-changed-files.outputs.ci_any_changed }}" == "true" ] || \
             [ "${{ steps.core-changed-files.outputs.docs_any_changed }}" == "true" ] || \
             [ "${{ steps.core-changed-files.outputs.src_any_changed }}" == "true" ] || \
             [ "${{ steps.core-changed-files.outputs.tests_any_changed }}" == "true" ] || \
             [ "${{ steps.core-changed-files.outputs.gha_src_any_changed }}" == "true" ] || \
             [ "${{ steps.core-changed-files.outputs.gha_tests_any_changed }}" == "true" ]; then
              printf '%s\n' "any_changed=true" >> $GITHUB_OUTPUT
          fi

    outputs:
      # essentially casts the string output to a boolean for GitHub
      any-file-changes: ${{ steps.all-changes.outputs.any_changed }}
      build-changes: ${{ steps.core-changed-files.outputs.build_any_changed }}
      ci-changes: ${{ steps.ci-changed-files.outputs.ci_any_changed }}
      doc-changes: ${{ steps.core-changed-files.outputs.docs_any_changed }}
      src-changes: ${{ steps.core-changed-files.outputs.src_any_changed }}
      test-changes: ${{ steps.core-changed-files.outputs.tests_any_changed }}
      gha-src-changes: ${{ steps.core-changed-files.outputs.gha_src_any_changed }}
      gha-test-changes: ${{ steps.core-changed-files.outputs.gha_tests_any_changed }}


  validate:
    needs: eval-changes
    uses: ./.github/workflows/validate.yml
    with:
      python-versions-linux: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]'
      # Since the test suite takes ~4 minutes to complete on windows, and windows is billed higher
      # we are only going to run it on the oldest version of python we support. The older version
      # will be the most likely area to fail as newer minor versions maintain compatibility.
      python-versions-windows: '["3.8"]'
      files-changed: ${{ needs.eval-changes.outputs.any-file-changes }}
      build-files-changed: ${{ needs.eval-changes.outputs.build-changes }}
      ci-files-changed: ${{ needs.eval-changes.outputs.ci-changes }}
      doc-files-changed: ${{ needs.eval-changes.outputs.doc-changes }}
      src-files-changed: ${{ needs.eval-changes.outputs.src-changes }}
      test-files-changed: ${{ needs.eval-changes.outputs.test-changes }}
      gha-src-files-changed: ${{ needs.eval-changes.outputs.gha-src-changes }}
      gha-test-files-changed: ${{ needs.eval-changes.outputs.gha-test-changes }}
    permissions: {}
    secrets: {}