Skip to content

Commit 6c0c0e5

Browse files
authored
Merge pull request #634 from pulp/update-ci/main
Update CI files for branch main
2 parents a2b052b + 31ec917 commit 6c0c0e5

23 files changed

+559
-641
lines changed

.github/template_gitref

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2021.08.26-251-g45d399d
1+
2021.08.26-278-g22c5b00

.github/workflows/build.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# WARNING: DO NOT EDIT!
2+
#
3+
# This file was generated by plugin_template, and is managed by it. Please use
4+
# './plugin-template --github pulp_python' to update this file.
5+
#
6+
# For more info visit https://github.com/pulp/plugin_template
7+
8+
---
9+
name: "Build"
10+
on:
11+
workflow_call:
12+
13+
defaults:
14+
run:
15+
working-directory: "pulp_python"
16+
17+
jobs:
18+
build:
19+
runs-on: "ubuntu-latest"
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
path: "pulp_python"
26+
- uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.8"
29+
- name: Install python dependencies
30+
run: |
31+
echo ::group::PYDEPS
32+
pip install packaging wheel
33+
echo ::endgroup::
34+
- name: "Build package"
35+
run: "python3 setup.py sdist bdist_wheel --python-tag py3"
36+
- name: 'Upload Package whl'
37+
uses: "actions/upload-artifact@v3"
38+
with:
39+
name: "plugin_package"
40+
path: "pulp_python/dist/"
41+
if-no-files-found: "error"
42+
retention-days: 5

.github/workflows/ci.yml

+14-161
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ concurrency:
1313
group: ${{ github.ref_name }}-${{ github.workflow }}
1414
cancel-in-progress: true
1515

16+
defaults:
17+
run:
18+
working-directory: "pulp_python"
19+
1620
jobs:
1721

1822
ready-to-ship:
@@ -21,6 +25,7 @@ jobs:
2125
- uses: actions/checkout@v4
2226
with:
2327
fetch-depth: 0
28+
path: "pulp_python"
2429
- uses: actions/setup-python@v4
2530
with:
2631
python-version: "3.8"
@@ -31,177 +36,27 @@ jobs:
3136
env:
3237
PY_COLORS: '1'
3338
ANSIBLE_FORCE_COLOR: '1'
34-
GITHUB_PULL_REQUEST: ${{ github.event.number }}
35-
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
36-
GITHUB_BRANCH: ${{ github.head_ref }}
37-
GITHUB_REPO_SLUG: ${{ github.repository }}
3839
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3940
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
4041
run: sh .github/workflows/scripts/check_commit.sh
4142
- name: Verify requirements files
4243
run: python .ci/scripts/check_requirements.py
43-
single_commit:
44-
runs-on: ubuntu-latest
45-
name: Assert single commit
46-
if: github.base_ref == 'main'
47-
steps:
48-
- uses: actions/checkout@v4
49-
with:
50-
fetch-depth: 0
51-
- name: Checkout main
52-
run: git fetch origin main
53-
- name: create local main branch
54-
run: git branch main origin/main
55-
- name: Commit Count Check
56-
run: test `git log --oneline --no-merges HEAD ^main | wc -l ` = 1
5744

5845
lint:
59-
runs-on: ubuntu-latest
60-
61-
steps:
62-
- uses: actions/checkout@v4
63-
with:
64-
fetch-depth: 1
65-
- uses: actions/setup-python@v4
66-
with:
67-
python-version: "3.8"
68-
# lint_requirements contains tools needed for flake8, etc.
69-
- name: Install requirements
70-
run: pip3 install -r lint_requirements.txt
71-
72-
46+
uses: "./.github/workflows/lint.yml"
7347

74-
# Lint code.
75-
- name: Run flake8
76-
run: flake8
77-
78-
- name: Run extra lint checks
79-
run: "[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh"
80-
81-
# check for any files unintentionally left out of MANIFEST.in
82-
- name: Check manifest
83-
run: check-manifest
84-
85-
- name: Check for pulpcore imports outside of pulpcore.plugin
86-
run: sh .ci/scripts/check_pulpcore_imports.sh
87-
88-
- name: Check for gettext problems
89-
run: sh .ci/scripts/check_gettext.sh
90-
91-
test:
92-
runs-on: ubuntu-latest
93-
# run only after lint finishes
48+
build:
9449
needs: lint
95-
strategy:
96-
fail-fast: false
97-
matrix:
98-
env:
99-
- TEST: pulp
100-
- TEST: docs
101-
- TEST: azure
102-
- TEST: s3
103-
- TEST: lowerbounds
104-
outputs:
105-
deprecations-pulp: ${{ steps.deprecations.outputs.deprecations-pulp }}
106-
deprecations-azure: ${{ steps.deprecations.outputs.deprecations-azure }}
107-
deprecations-s3: ${{ steps.deprecations.outputs.deprecations-s3 }}
108-
deprecations-lowerbounds: ${{ steps.deprecations.outputs.deprecations-lowerbounds }}
50+
uses: "./.github/workflows/build.yml"
10951

110-
steps:
111-
- uses: actions/checkout@v4
112-
with:
113-
fetch-depth: 1
114-
115-
- uses: actions/setup-python@v4
116-
with:
117-
python-version: "3.8"
118-
119-
- name: Install httpie
120-
run: |
121-
echo ::group::HTTPIE
122-
pip install httpie
123-
echo ::endgroup::
124-
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/.ci/assets/httpie/" >> $GITHUB_ENV
125-
126-
- name: Set environment variables
127-
run: |
128-
echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV
129-
130-
- name: Before Install
131-
run: .github/workflows/scripts/before_install.sh
132-
shell: bash
133-
env:
134-
PY_COLORS: '1'
135-
ANSIBLE_FORCE_COLOR: '1'
136-
GITHUB_PULL_REQUEST: ${{ github.event.number }}
137-
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
138-
GITHUB_BRANCH: ${{ github.head_ref }}
139-
GITHUB_REPO_SLUG: ${{ github.repository }}
140-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141-
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
142-
143-
- name: Install
144-
run: .github/workflows/scripts/install.sh
145-
shell: bash
146-
env:
147-
PY_COLORS: '1'
148-
ANSIBLE_FORCE_COLOR: '1'
149-
GITHUB_PULL_REQUEST: ${{ github.event.number }}
150-
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
151-
GITHUB_BRANCH: ${{ github.head_ref }}
152-
GITHUB_REPO_SLUG: ${{ github.repository }}
153-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154-
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
155-
156-
- name: Before Script
157-
run: .github/workflows/scripts/before_script.sh
158-
shell: bash
159-
env:
160-
PY_COLORS: '1'
161-
ANSIBLE_FORCE_COLOR: '1'
162-
GITHUB_PULL_REQUEST: ${{ github.event.number }}
163-
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
164-
GITHUB_BRANCH: ${{ github.head_ref }}
165-
GITHUB_REPO_SLUG: ${{ github.repository }}
166-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167-
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
168-
REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }}
169-
170-
- name: Setting secrets
171-
if: github.event_name != 'pull_request'
172-
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
173-
env:
174-
SECRETS_CONTEXT: ${{ toJson(secrets) }}
175-
176-
- name: Script
177-
run: .github/workflows/scripts/script.sh
178-
shell: bash
179-
env:
180-
PY_COLORS: '1'
181-
ANSIBLE_FORCE_COLOR: '1'
182-
GITHUB_PULL_REQUEST: ${{ github.event.number }}
183-
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
184-
GITHUB_BRANCH: ${{ github.head_ref }}
185-
GITHUB_REPO_SLUG: ${{ github.repository }}
186-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187-
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
188-
189-
- name: Extract Deprecations from Logs
190-
id: deprecations
191-
run: echo deprecations-${{ matrix.env.TEST }}=$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0) >> $GITHUB_OUTPUT
52+
test:
53+
needs: build
54+
uses: "./.github/workflows/test.yml"
19255

193-
- name: Logs
194-
if: always()
195-
run: |
196-
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate"
197-
http --timeout 30 --check-status --pretty format --print hb "https://pulp${PULP_API_ROOT}api/v3/status/" || true
198-
docker images || true
199-
docker ps -a || true
200-
docker logs pulp || true
201-
docker exec pulp ls -latr /etc/yum.repos.d/ || true
202-
docker exec pulp cat /etc/yum.repos.d/* || true
203-
docker exec pulp bash -c "pip3 list && pip3 install pipdeptree && pipdeptree"
20456
deprecations:
57+
defaults:
58+
run:
59+
working-directory: "."
20560
runs-on: ubuntu-latest
20661
if: github.base_ref == 'main'
20762
needs: test
@@ -219,5 +74,3 @@ jobs:
21974
echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d
22075
echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d
22176
echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d
222-
223-

.github/workflows/codeql-analysis.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
language: [ 'python' ]
3131

3232
steps:
33-
- name: Checkout repository
34-
uses: actions/checkout@v3
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
3535

36-
- name: Initialize CodeQL
37-
uses: github/codeql-action/init@v2
38-
with:
39-
languages: ${{ matrix.language }}
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v2
38+
with:
39+
languages: ${{ matrix.language }}
4040

41-
- name: Perform CodeQL Analysis
42-
uses: github/codeql-action/analyze@v2
41+
- name: Perform CodeQL Analysis
42+
uses: github/codeql-action/analyze@v2

.github/workflows/create-branch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v4
2525
with:
2626
fetch-depth: 0
27-
path: pulp_python
27+
path: "pulp_python"
2828

2929
- uses: actions/setup-python@v4
3030
with:

.github/workflows/kanban.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
runs-on: ubuntu-latest
5959
name: Find issues linked to a PR
6060
outputs:
61-
linked-issues: ${{ steps.linked-issues.outputs.issues }}
61+
linked-issues: ${{ steps.linked-issues.outputs.issues }}
6262
steps:
6363
- name: Checkout
6464
uses: actions/checkout@v2

.github/workflows/lint.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# WARNING: DO NOT EDIT!
2+
#
3+
# This file was generated by plugin_template, and is managed by it. Please use
4+
# './plugin-template --github pulp_python' to update this file.
5+
#
6+
# For more info visit https://github.com/pulp/plugin_template
7+
8+
---
9+
name: "Lint"
10+
on:
11+
workflow_call:
12+
13+
defaults:
14+
run:
15+
working-directory: "pulp_python"
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 1
25+
path: "pulp_python"
26+
27+
- uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.8"
30+
31+
# lint_requirements contains tools needed for flake8, etc.
32+
- name: Install requirements
33+
run: pip3 install -r lint_requirements.txt
34+
35+
- name: Lint workflow files
36+
run: |
37+
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
38+
39+
# Lint code.
40+
- name: Run flake8
41+
run: flake8
42+
43+
- name: Run extra lint checks
44+
run: "[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh"
45+
46+
# check for any files unintentionally left out of MANIFEST.in
47+
- name: Check manifest
48+
run: check-manifest
49+
50+
- name: Check for pulpcore imports outside of pulpcore.plugin
51+
run: sh .ci/scripts/check_pulpcore_imports.sh
52+
53+
- name: Check for gettext problems
54+
run: sh .ci/scripts/check_gettext.sh

0 commit comments

Comments
 (0)