diff --git a/.github/workflows/test_branches.yml b/.github/workflows/test_branches.yml index 6650a663a1b..99c58becb19 100644 --- a/.github/workflows/test_branches.yml +++ b/.github/workflows/test_branches.yml @@ -31,9 +31,8 @@ env: jobs: lint: name: lint/style-and-typos - if: | - ${{ ! ( contains(github.event.pull_request.title, '[WIP]') || - github.event.pull_request.draft ) }} + # Note: 'env' is not available in GHA jobs..if context. + if: ${{ ! contains(github.event.pull_request.title, '[WIP]') }} runs-on: ubuntu-latest steps: - name: Checkout Pyomo source @@ -62,7 +61,7 @@ jobs: sudo resolvectl query github.com sudo resolvectl status - name: URL Checker - if: env.PYOMO_WORKFLOW == 'branch' + if: ${{ env.PYOMO_WORKFLOW == 'branch' }} uses: urlstechie/urlchecker-action@0.0.34 with: # A comma-separated list of file types to cover in the URL checks @@ -866,8 +865,8 @@ jobs: cover: name: process-coverage-${{ matrix.TARGET }} needs: build - # run even if a build job fails, but not if canceled (except for branches) - if: ${{ false }} + # run even if a build job fails, but not if canceled + if: ${{ success() || failure() }} runs-on: ${{ matrix.os }} timeout-minutes: 10 strategy: @@ -976,7 +975,9 @@ jobs: fi - name: Upload codecov reports - if: github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main' + if: | + env.PYOMO_WORKFLOW != 'branch' && + (github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main') uses: codecov/codecov-action@v6 with: files: coverage.xml @@ -987,6 +988,7 @@ jobs: - name: Upload other coverage reports if: | + env.PYOMO_WORKFLOW != 'branch' && hashFiles('coverage-other.xml') != '' && (github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main') uses: codecov/codecov-action@v6 diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index eb90c885aed..048562aca96 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -35,16 +35,16 @@ env: NEOS_EMAIL: tests@pyomo.org SRC_REF: ${{ github.head_ref || github.ref }} PYOMO_WORKFLOW: | - ${{ ( contains(github.event.pull_request.title, '[WIP]') || - github.event.pull_request.draft ) && 'draft_pr' - || github.event.pull_request.number && 'pr' || 'main' }} + ${{ contains(github.event.pull_request.title, '[WIP]') && 'wip' + || github.event.pull_request.draft && 'draft_pr' + || github.event.pull_request.number && 'pr' + || 'main' }} jobs: lint: name: lint/style-and-typos - if: | - ${{ ! ( contains(github.event.pull_request.title, '[WIP]') || - github.event.pull_request.draft ) }} + # Note: 'env' is not available in GHA jobs..if context. + if: ${{ ! contains(github.event.pull_request.title, '[WIP]') }} runs-on: ubuntu-latest steps: - name: Checkout Pyomo source @@ -73,7 +73,7 @@ jobs: sudo resolvectl query github.com sudo resolvectl status - name: URL Checker - if: env.PYOMO_WORKFLOW == 'branch' + if: ${{ env.PYOMO_WORKFLOW == 'branch' }} uses: urlstechie/urlchecker-action@0.0.34 with: # A comma-separated list of file types to cover in the URL checks @@ -919,8 +919,8 @@ jobs: cover: name: process-coverage-${{ matrix.TARGET }} needs: build - # run even if a build job fails, but not if canceled (except for branches) - if: success() || failure() + # run even if a build job fails, but not if canceled + if: ${{ success() || failure() }} runs-on: ${{ matrix.os }} timeout-minutes: 10 strategy: @@ -1029,7 +1029,9 @@ jobs: fi - name: Upload codecov reports - if: github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main' + if: | + env.PYOMO_WORKFLOW != 'branch' && + (github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main') uses: codecov/codecov-action@v6 with: files: coverage.xml @@ -1040,6 +1042,7 @@ jobs: - name: Upload other coverage reports if: | + env.PYOMO_WORKFLOW != 'branch' && hashFiles('coverage-other.xml') != '' && (github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main') uses: codecov/codecov-action@v6