Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot committed Jul 7, 2024
1 parent e1c1cdd commit bf17f0d
Show file tree
Hide file tree
Showing 12 changed files with 189 additions and 234 deletions.
1 change: 1 addition & 0 deletions .ci/ansible/Containerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN pip3 install
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt
{%- endif -%}
{%- endfor %}
{{ " " }}-c ./{{ plugins[0].name }}/.ci/assets/ci_constraints.txt

{% if pulp_env is defined and pulp_env %}
{% for key, value in pulp_env.items() %}
Expand Down
7 changes: 7 additions & 0 deletions .ci/assets/ci_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Pulpcore versions without the openapi command do no longer work in the CI
pulpcore>=3.21.30,!=3.23.*,!=3.24.*,!=3.25.*,!=3.26.*,!=3.27.*,!=3.29.*,!=3.30.*,!=3.31.*,!=3.32.*,!=3.33.*,!=3.34.*,!=3.35.*,!=3.36.*,!=3.37.*,!=3.38.*,!=3.40.*,!=3.41.*,!=3.42.*,!=3.43.*,!=3.44.*,!=3.45.*,!=3.46.*,!=3.47.*,!=3.48.*,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*



tablib!=3.6.0
# 3.6.0: This release introduced a regression removing the "html" optional dependency.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-341-g5cb6e90
2021.08.26-349-gba81617
65 changes: 64 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,29 @@ jobs:
with:
fetch-depth: 1
path: "pulp-certguard"
- uses: "actions/checkout@v4"
with:
fetch-depth: 1
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install packaging twine wheel
pip install packaging twine wheel mkdocs jq
echo ::endgroup::
- name: "Build package"
run: |
python3 setup.py sdist bdist_wheel --python-tag py3
twine check dist/*
- name: "Install built packages"
run: |
pip install dist/pulp_certguard-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
- name: "Generate api specs"
run: |
pulpcore-manager openapi --file "api.json"
- name: "Upload Package whl"
uses: "actions/upload-artifact@v4"
with:
Expand All @@ -43,3 +54,55 @@ jobs:
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Upload API specs"
uses: "actions/upload-artifact@v4"
with:
name: "api_spec"
path: |
pulp-certguard/api.json
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Build Python bindings packages"
run: |
.github/workflows/scripts/build_python_client.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: "Upload python client packages"
uses: "actions/upload-artifact@v4"
with:
name: "python-client.tar"
path: |
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Upload python client docs"
uses: "actions/upload-artifact@v4"
with:
name: "python-client-docs.tar"
path: |
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Build Ruby bindings packages"
run: |
.github/workflows/scripts/build_ruby_client.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: "Upload Ruby client"
uses: "actions/upload-artifact@v4"
with:
name: "ruby-client.tar"
path: |
if-no-files-found: "error"
retention-days: 5
overwrite: true
...
112 changes: 4 additions & 108 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,114 +19,10 @@ defaults:
jobs:
build:
uses: "./.github/workflows/build.yml"

build-bindings-docs:
needs:
- "build"
runs-on: "ubuntu-latest"
# Install scripts expect TEST to be set, 'docs' is most appropriate even though we don't run tests
env:
TEST: "docs"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 1
path: "pulp-certguard"

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

- uses: "actions/setup-python@v5"
with:
python-version: "3.11"

- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "pulp-certguard/dist/"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"

- 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-certguard/.ci/assets/httpie/" >> $GITHUB_ENV
echo ::endgroup::
# Building the bindings and docs requires accessing the OpenAPI specs endpoint, so we need to
# setup the Pulp instance.
- 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: "Install Python client"
run: |
.github/workflows/scripts/install_python_client.sh
shell: "bash"
- name: "Install Ruby client"
run: |
.github/workflows/scripts/install_ruby_client.sh
shell: "bash"

- name: "Upload python client packages"
uses: "actions/upload-artifact@v4"
with:
name: "python-client.tar"
path: |
if-no-files-found: "error"
overwrite: true

- name: "Upload python client docs"
uses: "actions/upload-artifact@v4"
with:
name: "python-client-docs.tar"
path: |
if-no-files-found: "error"
overwrite: true
- name: "Upload ruby client packages"
uses: "actions/upload-artifact@v4"
with:
name: "ruby-client.tar"
path: |
if-no-files-found: "error"
overwrite: true

- 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 && pip3 install pipdeptree && pipdeptree"
publish-package:
runs-on: "ubuntu-latest"
needs:
- "build-bindings-docs"
- "build"

env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand Down Expand Up @@ -164,7 +60,7 @@ jobs:
publish-python-bindings:
runs-on: "ubuntu-latest"
needs:
- "build-bindings-docs"
- "build"

env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand Down Expand Up @@ -206,7 +102,7 @@ jobs:
publish-ruby-bindings:
runs-on: "ubuntu-latest"
needs:
- "build-bindings-docs"
- "build"

env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand Down Expand Up @@ -243,7 +139,7 @@ jobs:
create-gh-release:
runs-on: "ubuntu-latest"
needs:
- "build-bindings-docs"
- "build"
- "publish-package"
- "publish-python-bindings"
- "publish-ruby-bindings"
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/scripts/build_python_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# This script expects all <app_label>-api.json files to exist in the plugins root directory.
# It produces a <app_label>-python-client.tar and <app_label>-python-client-docs.tar file in the plugins root directory.

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_certguard' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

set -mveuo pipefail

# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..

pushd ../pulp-openapi-generator
popd
19 changes: 19 additions & 0 deletions .github/workflows/scripts/build_ruby_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# This script expects all <app_label>-api.json files to exist in the plugins root directory.
# It produces a <app_label>-ruby-client.tar file in the plugins root directory.

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_certguard' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template

set -mveuo pipefail

# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..

pushd ../pulp-openapi-generator
popd
27 changes: 0 additions & 27 deletions .github/workflows/scripts/install_python_client.sh

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/scripts/install_ruby_client.sh

This file was deleted.

Loading

0 comments on commit bf17f0d

Please sign in to comment.