Skip to content

Commit bedd573

Browse files
authored
Merge pull request #636 from pulp/update-ci/main
Update CI files for branch main
2 parents 6c0c0e5 + c3ab102 commit bedd573

22 files changed

+489
-340
lines changed

.github/template_gitref

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-278-g22c5b00
1+
2021.08.26-293-gde76e9f

.github/workflows/build.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@ jobs:
1919
runs-on: "ubuntu-latest"
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: "actions/checkout@v4"
2323
with:
2424
fetch-depth: 1
2525
path: "pulp_python"
26-
- uses: actions/setup-python@v4
26+
- uses: "actions/setup-python@v4"
2727
with:
2828
python-version: "3.8"
29-
- name: Install python dependencies
29+
- name: "Install python dependencies"
3030
run: |
3131
echo ::group::PYDEPS
32-
pip install packaging wheel
32+
pip install packaging twine wheel
3333
echo ::endgroup::
3434
- name: "Build package"
35-
run: "python3 setup.py sdist bdist_wheel --python-tag py3"
36-
- name: 'Upload Package whl'
35+
run: |
36+
python3 setup.py sdist bdist_wheel --python-tag py3
37+
twine check dist/*
38+
- name: "Upload Package whl"
3739
uses: "actions/upload-artifact@v3"
3840
with:
3941
name: "plugin_package"

.github/workflows/changelog.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,53 @@
66
# For more info visit https://github.com/pulp/plugin_template
77

88
---
9-
name: Python changelog update
9+
name: "Python changelog update"
1010
on:
1111
push:
1212
branches:
13-
- main
13+
- "main"
1414
paths:
15-
- CHANGES.rst
16-
- CHANGES.md
15+
- "CHANGES.rst"
16+
- "CHANGES.md"
1717
workflow_dispatch:
1818

1919
jobs:
2020

2121
update-changelog:
22-
runs-on: ubuntu-latest
22+
runs-on: "ubuntu-latest"
2323
strategy:
2424
fail-fast: false
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: "actions/checkout@v4"
2828
with:
2929
fetch-depth: 1
3030

31-
- uses: actions/setup-python@v4
31+
- uses: "actions/setup-python@v4"
3232
with:
3333
python-version: "3.8"
3434

35-
- name: Install python dependencies
35+
- name: "Install python dependencies"
3636
run: |
3737
echo ::group::PYDEPS
3838
pip install -r doc_requirements.txt
3939
echo ::endgroup::
4040
41-
- name: Fake api schema
41+
- name: "Fake api schema"
4242
run: |
4343
mkdir -p docs/_build/html
4444
echo "{}" > docs/_build/html/api.json
4545
mkdir -p docs/_static
4646
echo "{}" > docs/_static/api.json
47-
- name:
47+
- name: "Build Docs"
4848
run: |
49-
pip install "Jinja2<3.1"
5049
make diagrams html
51-
working-directory: ./docs
50+
working-directory: "./docs"
5251
env:
5352
PULP_CONTENT_ORIGIN: "http://localhost/"
5453

55-
- name: Publish changlog to pulpproject.org
56-
run: .github/workflows/scripts/publish_docs.sh changelog ${GITHUB_REF##*/}
54+
- name: "Publish changlog to pulpproject.org"
55+
run: |
56+
.github/workflows/scripts/publish_docs.sh changelog ${GITHUB_REF##*/}
5757
env:
58-
PULP_DOCS_KEY: ${{ secrets.PULP_DOCS_KEY }}
58+
PULP_DOCS_KEY: "${{ secrets.PULP_DOCS_KEY }}"

.github/workflows/ci.yml

+51-34
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# For more info visit https://github.com/pulp/plugin_template
77

88
---
9-
name: Python CI
9+
name: "Python CI"
1010
on: {pull_request: {branches: ['*']}}
1111

1212
concurrency:
@@ -18,59 +18,76 @@ defaults:
1818
working-directory: "pulp_python"
1919

2020
jobs:
21-
22-
ready-to-ship:
23-
runs-on: ubuntu-latest
21+
check-commits:
22+
runs-on: "ubuntu-latest"
2423
steps:
25-
- uses: actions/checkout@v4
24+
- uses: "actions/checkout@v4"
2625
with:
2726
fetch-depth: 0
2827
path: "pulp_python"
29-
- uses: actions/setup-python@v4
28+
- uses: "actions/setup-python@v4"
3029
with:
3130
python-version: "3.8"
32-
- name: Install requirements
33-
run: pip3 install github
34-
- name: Check commit message
31+
- name: "Install python dependencies"
32+
run: |
33+
echo ::group::PYDEPS
34+
pip install requests pygithub
35+
echo ::endgroup::
36+
- name: "Check commit message"
3537
if: github.event_name == 'pull_request'
3638
env:
37-
PY_COLORS: '1'
38-
ANSIBLE_FORCE_COLOR: '1'
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
41-
run: sh .github/workflows/scripts/check_commit.sh
42-
- name: Verify requirements files
43-
run: python .ci/scripts/check_requirements.py
39+
PY_COLORS: "1"
40+
ANSIBLE_FORCE_COLOR: "1"
41+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
42+
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
43+
run: |
44+
.github/workflows/scripts/check_commit.sh
45+
- name: "Verify requirements files"
46+
run: |
47+
python .ci/scripts/check_requirements.py
4448
4549
lint:
4650
uses: "./.github/workflows/lint.yml"
4751

4852
build:
49-
needs: lint
53+
needs: "lint"
5054
uses: "./.github/workflows/build.yml"
5155

5256
test:
53-
needs: build
57+
needs: "build"
5458
uses: "./.github/workflows/test.yml"
5559

5660
deprecations:
57-
defaults:
58-
run:
59-
working-directory: "."
60-
runs-on: ubuntu-latest
61+
runs-on: "ubuntu-latest"
6162
if: github.base_ref == 'main'
62-
needs: test
63+
needs: "test"
6364
steps:
64-
- name: Fail on deprecations
65+
- name: "Create working directory"
66+
run: |
67+
mkdir -p "pulp_python"
68+
working-directory: "."
69+
- name: "Download Deprecations"
70+
uses: actions/download-artifact@v3
71+
with:
72+
name: "deprecations"
73+
path: "pulp_python"
74+
- name: "Print deprecations"
6575
run: |
66-
test -z "${{ needs.test.outputs.deprecations-pulp }}"
67-
test -z "${{ needs.test.outputs.deprecations-azure }}"
68-
test -z "${{ needs.test.outputs.deprecations-s3 }}"
69-
test -z "${{ needs.test.outputs.deprecations-lowerbounds }}"
70-
- name: Print deprecations
71-
if: failure()
76+
cat deprecations-*.txt | sort -u
77+
! cat deprecations-*.txt | grep '[^[:space:]]'
78+
79+
ready-to-ship:
80+
# This is a dummy dependent task to have a single entry for the branch protection rules.
81+
runs-on: "ubuntu-latest"
82+
needs:
83+
- "check-commits"
84+
- "lint"
85+
- "test"
86+
if: "always()"
87+
steps:
88+
- name: "Collect needed jobs results"
89+
working-directory: "."
7290
run: |
73-
echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d
74-
echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d
75-
echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d
76-
echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d
91+
echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
92+
echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
93+
echo "CI says: Looks good!"

.github/workflows/create-branch.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,27 @@ jobs:
2121
fail-fast: false
2222

2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: "actions/checkout@v4"
2525
with:
2626
fetch-depth: 0
2727
path: "pulp_python"
2828

29-
- uses: actions/setup-python@v4
29+
- uses: "actions/setup-python@v4"
3030
with:
3131
python-version: "3.8"
3232

33-
- name: Install python dependencies
33+
- name: "Install python dependencies"
3434
run: |
3535
echo ::group::PYDEPS
3636
pip install bump2version jinja2 pyyaml
3737
echo ::endgroup::
3838
39-
- name: Setting secrets
40-
working-directory: pulp_python
41-
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
39+
- name: "Setting secrets"
40+
working-directory: "pulp_python"
41+
run: |
42+
python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
4243
env:
43-
SECRETS_CONTEXT: ${{ toJson(secrets) }}
44+
SECRETS_CONTEXT: "${{ toJson(secrets) }}"
4445

4546
- name: Determine new branch name
4647
working-directory: pulp_python

.github/workflows/lint.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ jobs:
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: "actions/checkout@v4"
2323
with:
2424
fetch-depth: 1
2525
path: "pulp_python"
2626

27-
- uses: actions/setup-python@v4
27+
- uses: "actions/setup-python@v4"
2828
with:
2929
python-version: "3.8"
3030

31-
# lint_requirements contains tools needed for flake8, etc.
32-
- name: Install requirements
33-
run: pip3 install -r lint_requirements.txt
31+
- name: "Install python dependencies"
32+
run: |
33+
echo ::group::PYDEPS
34+
pip install -r lint_requirements.txt
35+
echo ::endgroup::
3436
3537
- name: Lint workflow files
3638
run: |

.github/workflows/nightly.yml

+13-24
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ jobs:
3333
changelog:
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v4
36+
- uses: "actions/checkout@v4"
3737
with:
3838
fetch-depth: 0
3939
path: "pulp_python"
4040

41-
- uses: actions/setup-python@v4
41+
- uses: "actions/setup-python@v4"
4242
with:
4343
python-version: "3.11"
4444

45-
- name: Install python dependencies
45+
- name: "Install python dependencies"
4646
run: |
4747
echo ::group::PYDEPS
4848
pip install gitpython toml
4949
echo ::endgroup::
5050
51-
- name: Configure Git with pulpbot name and email
51+
- name: "Configure Git with pulpbot name and email"
5252
run: |
5353
git config --global user.name 'pulpbot'
5454
git config --global user.email '[email protected]'
@@ -71,7 +71,7 @@ jobs:
7171
needs: test
7272

7373
steps:
74-
- uses: actions/checkout@v4
74+
- uses: "actions/checkout@v4"
7575
with:
7676
fetch-depth: 1
7777
path: "pulp_python"
@@ -81,17 +81,17 @@ jobs:
8181
name: "plugin_package"
8282
path: "pulp_python/dist/"
8383

84-
- uses: actions/setup-python@v4
84+
- uses: "actions/setup-python@v4"
8585
with:
8686
python-version: "3.8"
8787

88-
- name: Install python dependencies
88+
- name: "Install python dependencies"
8989
run: |
9090
echo ::group::PYDEPS
91-
pip install requests
91+
pip install requests 'packaging~=21.3' mkdocs pymdown-extensions 'Jinja2<3.1'
9292
echo ::endgroup::
9393
94-
- name: Set environment variables
94+
- name: "Set environment variables"
9595
run: |
9696
echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV
9797
@@ -107,24 +107,13 @@ jobs:
107107
name: "python-client-docs.tar"
108108
path: "pulp_python"
109109

110-
- name: Setting secrets
111-
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
110+
- name: "Setting secrets"
111+
run: |
112+
python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
112113
env:
113-
SECRETS_CONTEXT: ${{ toJson(secrets) }}
114+
SECRETS_CONTEXT: "${{ toJson(secrets) }}"
114115

115116
- name: Publish docs to pulpproject.org
116117
run: |
117118
tar -xvf docs.tar -C ./docs
118119
.github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/}
119-
120-
- name: Logs
121-
if: always()
122-
run: |
123-
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate"
124-
http --timeout 30 --check-status --pretty format --print hb "https://pulp${PULP_API_ROOT}api/v3/status/" || true
125-
docker images || true
126-
docker ps -a || true
127-
docker logs pulp || true
128-
docker exec pulp ls -latr /etc/yum.repos.d/ || true
129-
docker exec pulp cat /etc/yum.repos.d/* || true
130-
docker exec pulp bash -c "pip3 list && pip3 install pipdeptree && pipdeptree"

.github/workflows/pr_checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
permissions:
2727
pull-requests: write
2828
steps:
29-
- uses: actions/checkout@v4
29+
- uses: "actions/checkout@v4"
3030
with:
3131
fetch-depth: 0
3232
- name: Commit Count Check

0 commit comments

Comments
 (0)