Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
  • Loading branch information
pulpbot committed Dec 1, 2024
1 parent f46cdfc commit 96982ce
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 129 deletions.
5 changes: 4 additions & 1 deletion .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def template_config():
def current_version(repo, commitish):
try:
pyproject_toml = tomllib.loads(repo.git.show(f"{commitish}:pyproject.toml"))
current_version = pyproject_toml["project"]["version"]
try:
current_version = pyproject_toml["project"]["version"]
except Exception:
current_version = pyproject_toml["tool"]["bumpversion"]["current_version"]
except Exception:
current_version = repo.git.grep(
"current_version", commitish, "--", ".bumpversion.cfg"
Expand Down
5 changes: 4 additions & 1 deletion .ci/scripts/check_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def main():
else:
if check_prereleases and req.specifier.prereleases:
# Do not even think about begging for more exceptions!
if req.name != "pulp-file-client":
if (
not req.name.startswith("opentelemetry")
and req.name != "pulp-file-client"
):
errors.append(f"{filename}:{nr}: Prerelease versions found in {line}.")
ops = [spec.operator for spec in req.specifier]
if "~=" in ops:
Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-399-g78ad960
2021.08.26-405-g3845bbc
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
test:
needs: "build"
uses: "./.github/workflows/test.yml"
with:
matrix_env: |
[{"TEST": "pulp"}, {"TEST": "azure"}, {"TEST": "s3"}, {"TEST": "lowerbounds"}]
deprecations:
runs-on: "ubuntu-latest"
Expand Down
119 changes: 4 additions & 115 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
test:
needs: "build"
uses: "./.github/workflows/test.yml"
with:
matrix_env: |
[{"TEST": "pulp"}, {"TEST": "azure"}, {"TEST": "s3"}, {"TEST": "lowerbounds"}, {"TEST": "performance"}]
changelog:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -65,118 +68,4 @@ jobs:
branch: "changelog/update"
delete-branch: true
path: "pulp_file"

performance:
runs-on: ubuntu-latest
needs: test

strategy:
fail-fast: false
matrix:
env:
- TEST: performance

steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 1
path: "pulp_file"

- uses: "actions/checkout@v4"
with:
fetch-depth: 1
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"

- uses: actions/download-artifact@v4
with:
name: "plugin_package"
path: "pulp_file/dist/"

- name: "Download API specs"
uses: "actions/download-artifact@v4"
with:
name: "api_spec"
path: "pulp_file/"

- name: "Download client packages"
uses: "actions/download-artifact@v4"
with:
name: "python-client.tar"
path: "pulp_file"

- name: "Unpack client packages"
working-directory: "pulp-openapi-generator"
run: |
mkdir -p "pulp_file-client"
pushd "pulp_file-client"
tar xvf "../../pulp_file/file-python-client.tar"
popd
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

- name: "Set environment variables"
run: |
echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install towncrier twine wheel httpie docker netaddr boto3 ansible mkdocs
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/pulp_file/.ci/assets/httpie/" >> $GITHUB_ENV
echo ::endgroup::
- name: "Before Install"
run: |
.github/workflows/scripts/before_install.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"

- name: "Install"
run: |
.github/workflows/scripts/install.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"

- name: "Before Script"
run: |
.github/workflows/scripts/before_script.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
REDIS_DISABLED: "${{ contains('s3', matrix.env.TEST) }}"

- name: "Performance Test"
run: |
.github/workflows/scripts/script.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"

- name: "Logs"
if: always()
run: |
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate"
http --timeout 30 --check-status --pretty format --print hb "https://pulp${PULP_API_ROOT}api/v3/status/" || true
docker images || true
docker ps -a || true
docker logs pulp || true
docker exec pulp ls -latr /etc/yum.repos.d/ || true
docker exec pulp cat /etc/yum.repos.d/* || true
docker exec pulp bash -c "pip3 list" || true
...
4 changes: 2 additions & 2 deletions .github/workflows/scripts/publish_plugin_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ then
fi

twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulp_file-$VERSION-py3-none-any.whl" \
"dist/pulp-file-$VERSION.tar.gz" \
dist/pulp?file-"$VERSION"-py3-none-any.whl \
dist/pulp?file-"$VERSION".tar.gz \
;
14 changes: 5 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
name: "Test"
on:
workflow_call:
inputs:
matrix_env:
required: true
type: string

defaults:
run:
Expand All @@ -20,11 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
env:
- TEST: pulp
- TEST: azure
- TEST: s3
- TEST: lowerbounds
env: ${{ fromJSON(inputs.matrix_env) }}

steps:
- uses: "actions/checkout@v4"
Expand Down Expand Up @@ -88,10 +88,6 @@ jobs:
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
- uses: ruby/setup-ruby@v1
if: ${{ env.TEST == 'pulp' }}
with:
ruby-version: "2.6"

- name: "Install"
run: |
Expand Down

0 comments on commit 96982ce

Please sign in to comment.