-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the CI files too. [noissue]
- Loading branch information
Showing
24 changed files
with
332 additions
and
193 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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CONTENT_ORIGIN = "http://localhost:8080/" | ||
ALLOWED_EXPORT_PATHS = ["/tmp"] | ||
TELEMETRY = False | ||
ANALYTICS = False |
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: "Build" | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/cache@v3" | ||
with: | ||
path: "~/.cache/pip" | ||
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}" | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "3.11" | ||
- name: "Install python dependencies" | ||
run: | | ||
pip install build setuptools wheel | ||
- name: "Build wheels" | ||
run: | | ||
make build | ||
- name: "Upload wheels" | ||
uses: "actions/upload-artifact@v4" | ||
with: | ||
name: "pulp_cli_packages" | ||
path: | | ||
pulp-glue-gem/dist/ | ||
dist/ | ||
if-no-files-found: "error" | ||
retention-days: 5 |
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 |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
with: | ||
ref: "main" | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Setup git | ||
|
@@ -20,7 +20,7 @@ jobs: | |
git config user.email [email protected] | ||
- name: Collect changes | ||
run: | | ||
pip install GitPython toml | ||
pip install GitPython packaging toml | ||
python3 .ci/scripts/collect_changes.py | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
|
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,30 +1,36 @@ | ||
name: Lint | ||
name: "Lint" | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python: | ||
- "3.8" | ||
- "3.11" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v4 | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/cache@v4" | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }} | ||
path: "~/.cache/pip" | ||
key: "${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/*constraints.lock', '**/setup.py', '**/pyproject.toml') }}" | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: "Download wheels" | ||
uses: "actions/download-artifact@v4" | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install python dependencies | ||
run: pip install -r lint_requirements.txt | ||
- name: Lint code | ||
run: make lint | ||
name: "pulp_cli_packages" | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "${{ matrix.python }}" | ||
- name: "Install python dependencies" | ||
run: | | ||
pip install dist/pulp_cli_gem-*.whl pulp-glue-gem/dist/pulp_glue_gem-*.whl -r lint_requirements.txt | ||
- name: "Lint code" | ||
run: | | ||
make lint |
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,15 +1,19 @@ | ||
name: pulp-cli Nightly | ||
name: "pulp-cli Nightly" | ||
|
||
on: | ||
schedule: | ||
- cron: "15 3 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: "./.github/workflows/build.yml" | ||
test: | ||
needs: | ||
- "build" | ||
uses: "./.github/workflows/test.yml" | ||
codeql: | ||
uses: "./.github/workflows/codeql.yml" | ||
collect_changes: | ||
uses: "./.github/workflows/collect_changes.yml" | ||
secrets: inherit | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,66 @@ | ||
name: pulp-cli CI | ||
name: "pulp-cli CI" | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: main-${{ github.ref_name }}-${{ github.workflow }} | ||
group: "main-${{ github.ref_name }}-${{ github.workflow }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
uses: "./.github/workflows/build.yml" | ||
lint: | ||
needs: | ||
- "build" | ||
uses: "./.github/workflows/lint.yml" | ||
test: | ||
needs: | ||
- lint | ||
- "lint" | ||
uses: "./.github/workflows/test.yml" | ||
codeql: | ||
needs: | ||
- lint | ||
- "lint" | ||
uses: "./.github/workflows/codeql.yml" | ||
check-commits: | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch --prune --unshallow | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v5" | ||
with: | ||
python-version: "3.11" | ||
- name: Install python dependencies | ||
run: pip install toml pygithub | ||
- name: Check commit message | ||
- name: "Install python dependencies" | ||
run: | | ||
pip install toml pygithub | ||
- name: "Check commit message" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}" | ||
run: | | ||
for sha in $(curl -H "Authorization: token $GITHUB_TOKEN" $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g') | ||
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha') | ||
do | ||
python .ci/scripts/validate_commit_message.py $sha | ||
python .ci/scripts/validate_commit_message.py "$SHA" | ||
VALUE=$? | ||
if [ "$VALUE" -gt 0 ]; then | ||
exit "$VALUE" | ||
fi | ||
done | ||
shell: bash | ||
shell: "bash" | ||
ready-to-ship: | ||
# This is a dummy dependent task to have a single entry for the branch protection rules. | ||
runs-on: ubuntu-latest | ||
runs-on: "ubuntu-latest" | ||
needs: | ||
- check-commits | ||
- lint | ||
- test | ||
- codeql | ||
- "check-commits" | ||
- "lint" | ||
- "test" | ||
- "codeql" | ||
if: "always()" | ||
steps: | ||
- name: All set | ||
- name: "Collect needed jobs results" | ||
run: | | ||
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result' | ||
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0' | ||
echo "CI says: Looks good!" |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
name: "Pulp CLI PR static checks" | ||
on: | ||
pull_request_target: | ||
types: ["opened", "synchronize", "reopened"] | ||
|
||
# This workflow runs with elevated permissions. | ||
# Do not even think about running a single bit of code from the PR. | ||
# Static analysis should be fine however. | ||
|
||
concurrency: | ||
group: "${{ github.event.pull_request.number }}-${{ github.workflow }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
single_commit: | ||
runs-on: "ubuntu-latest" | ||
name: "Label multiple commit PR" | ||
permissions: | ||
pull-requests: "write" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
with: | ||
fetch-depth: 0 | ||
- name: "Commit Count Check" | ||
run: | | ||
git fetch origin ${{ github.event.pull_request.head.sha }} | ||
echo "COMMIT_COUNT=$(git log --oneline --no-merges origin/${{ github.base_ref }}..${{ github.event.pull_request.head.sha }} | wc -l)" >> "$GITHUB_ENV" | ||
- uses: "actions/github-script@v7" | ||
with: | ||
script: | | ||
const labelName = "multi-commit"; | ||
const { COMMIT_COUNT } = process.env; | ||
if (COMMIT_COUNT == 1) | ||
{ | ||
try { | ||
await github.rest.issues.removeLabel({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
name: labelName, | ||
}); | ||
} catch(err) { | ||
} | ||
} | ||
else | ||
{ | ||
await github.rest.issues.addLabels({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
labels: [labelName], | ||
}); | ||
} |
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 |
---|---|---|
@@ -1,27 +1,28 @@ | ||
name: pulp-cli Release | ||
name: "pulp-cli Release" | ||
|
||
on: | ||
workflow_dispatch | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
name: "Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: "actions/checkout@v4" | ||
with: | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
token: "${{ secrets.RELEASE_TOKEN }}" | ||
- name: "Set up Python" | ||
uses: "actions/setup-python@v5" | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
python-version: "3.x" | ||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install bump2version towncrier | ||
- name: Setup git | ||
pip install bump2version towncrier~=23.11.0 | ||
- name: "Setup git" | ||
run: | | ||
git config user.name pulpbot | ||
git config user.email [email protected] | ||
- name: Release | ||
run: .ci/scripts/release.sh | ||
- name: "Release" | ||
run: | | ||
.ci/scripts/release.sh |
Oops, something went wrong.