-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
201 additions
and
142 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
# see https://github.com/ansible/devtools | ||
_extends: ansible/devtools | ||
# see https://github.com/ansible/team-devtools | ||
_extends: ansible/team-devtools |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
--- | ||
# See https://github.com/ansible/devtools/blob/main/.github/workflows/ack.yml | ||
# See https://github.com/ansible/team-devtools/blob/main/.github/workflows/ack.yml | ||
name: ack | ||
on: | ||
pull_request_target: | ||
types: [opened, labeled, unlabeled, synchronize] | ||
|
||
jobs: | ||
ack: | ||
uses: ansible/devtools/.github/workflows/ack.yml@main | ||
uses: ansible/team-devtools/.github/workflows/ack.yml@main | ||
secrets: inherit |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,12 @@ | |
name: tox | ||
|
||
on: | ||
create: # is used for publishing to PyPI and TestPyPI | ||
tags: # any tag regardless of its name, no branches | ||
- "**" | ||
push: # only publishes pushes to the main branch to TestPyPI | ||
branches: # any integration branch but not tag | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "main" | ||
release: | ||
types: | ||
- published # It seems that you can publish directly without creating | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
|
@@ -24,8 +18,8 @@ env: | |
PY_COLORS: 1 | ||
|
||
jobs: | ||
pre: | ||
name: pre | ||
prepare: | ||
name: prepare | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
matrix: ${{ steps.generate_matrix.outputs.matrix }} | ||
|
@@ -46,15 +40,18 @@ jobs: | |
build: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os || 'ubuntu-22.04' }} | ||
environment: test | ||
needs: pre | ||
needs: | ||
- prepare | ||
defaults: | ||
run: | ||
shell: ${{ matrix.shell || 'bash'}} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.pre.outputs.matrix) }} | ||
|
||
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} | ||
env: | ||
# Number of expected test passes, safety measure for accidental skip of | ||
# tests. Update value if you add/remove tests. | ||
PYTEST_REQPASS: 7 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -90,27 +87,14 @@ jobs: | |
- name: tox -e ${{ matrix.passed_name }} | ||
run: python3 -m tox -e ${{ matrix.passed_name }} | ||
|
||
- name: Combine coverage data | ||
if: ${{ startsWith(matrix.passed_name, 'py') }} | ||
# produce a single .coverage file at repo root | ||
run: tox -e coverage | ||
|
||
- name: Upload coverage data | ||
if: ${{ startsWith(matrix.passed_name, 'py') }} | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: ${{ matrix.passed_name }} | ||
fail_ci_if_error: true # see https://github.com/codecov/codecov-action/issues/598 | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true # optional (default = false) | ||
|
||
- name: Archive logs | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: logs-${{ matrix.name }}.zip | ||
path: .tox/**/log/ | ||
# https://github.com/actions/upload-artifact/issues/123 | ||
continue-on-error: true | ||
path: | | ||
.tox/**/log/ | ||
.tox/**/.coverage* | ||
.tox/**/coverage.xml | ||
- name: Report failure if git reports dirty status | ||
run: | | ||
|
@@ -125,6 +109,8 @@ jobs: | |
check: # This job does nothing and is only used for the branch protection | ||
if: always() | ||
permissions: | ||
checks: read # codecov-action | ||
id-token: write # codecov-action | ||
pull-requests: write # allow codenotify to comment on pull-request | ||
|
||
needs: | ||
|
@@ -133,17 +119,56 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# checkout needed for codecov action which needs codecov.yml file | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python # likely needed for coverage | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- run: pip3 install 'coverage>=7.5.1' | ||
|
||
- name: Merge logs into a single archive | ||
uses: actions/upload-artifact/merge@v4 | ||
with: | ||
name: logs.zip | ||
pattern: logs-*.zip | ||
# artifacts like py312.zip and py312-macos do have overlapping files | ||
separate-directories: true | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: logs.zip | ||
path: . | ||
|
||
- name: Check for expected number of coverage.xml reports | ||
run: | | ||
JOBS_PRODUCING_COVERAGE=4 | ||
if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then | ||
echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)" | ||
exit 1 | ||
fi | ||
- name: Upload coverage data | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
name: ${{ matrix.passed_name }} | ||
# verbose: true # optional (default = false) | ||
fail_ci_if_error: true | ||
use_oidc: true # cspell:ignore oidc | ||
|
||
- name: Check codecov.io status | ||
if: github.event_name == 'pull_request' | ||
uses: coactions/codecov-status@main | ||
|
||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
|
||
- name: Check out src from Git | ||
uses: actions/checkout@v4 | ||
|
||
- name: Notify repository owners about lint change affecting them | ||
uses: sourcegraph/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# https://github.com/sourcegraph/codenotify/issues/19 | ||
continue-on-error: true | ||
- name: Delete Merged Artifacts | ||
uses: actions/upload-artifact/merge@v4 | ||
with: | ||
delete-merged: true |
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
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
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
Oops, something went wrong.