Skip to content

Commit

Permalink
Experiment: Update CI
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Nov 18, 2023
1 parent b9d5fb2 commit 675ee02
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-259-ge0f38f0
2021.08.26-266-g853c178
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@
# For more info visit https://github.com/pulp/plugin_template

---
name: Build
name: "Build"
on:
workflow_call:

defaults:
run:
working-directory: "pulp_gem"

jobs:
build:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: "pulp_gem"
- uses: actions/setup-python@v4
with:
python-version: "3.8"
Expand All @@ -26,12 +31,12 @@ jobs:
echo ::group::PYDEPS
pip install packaging wheel
echo ::endgroup::
- name: Build package
run: python3 setup.py sdist bdist_wheel --python-tag py3
- name: "Build package"
run: "python3 setup.py sdist bdist_wheel --python-tag py3"
- name: 'Upload Package whl'
uses: actions/upload-artifact@v3
uses: "actions/upload-artifact@v3"
with:
name: plugin_package
path: dist/
if-no-files-found: error
name: "plugin_package"
path: "pulp_gem/dist/"
if-no-files-found: "error"
retention-days: 5
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: sh .github/workflows/scripts/check_commit.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: pulp_gem
path: "pulp_gem"

- uses: actions/setup-python@v4
with:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@
# For more info visit https://github.com/pulp/plugin_template

---
name: Lint
name: "Lint"
on:
workflow_call:

defaults:
run:
working-directory: "pulp_gem"

jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -18,9 +22,12 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: "pulp_gem"

- uses: actions/setup-python@v4
with:
python-version: "3.8"

# lint_requirements contains tools needed for flake8, etc.
- name: Install requirements
run: pip3 install -r lint_requirements.txt
Expand Down
106 changes: 44 additions & 62 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@
# For more info visit https://github.com/pulp/plugin_template

---
name: Gem Nightly CI
name: "Gem Nightly CI"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# runs at 3:00 UTC daily
- cron: '00 3 * * *'
workflow_dispatch:

defaults:
run:
working-directory: "pulp_gem"

concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
group: "${{ github.ref_name }}-${{ github.workflow }}"
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/build.yml
uses: "./.github/workflows/build.yml"

test:
runs-on: ubuntu-latest
needs: build
runs-on: "ubuntu-latest"
needs: "build"

strategy:
fail-fast: false
Expand All @@ -42,11 +46,18 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: "pulp_gem"

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

- uses: actions/download-artifact@v3
with:
name: plugin_package
path: dist/
name: "plugin_package"
path: "pulp_gem/dist/"

- uses: actions/setup-python@v4
with:
Expand All @@ -69,10 +80,6 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}

Expand All @@ -87,10 +94,6 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}

Expand All @@ -100,19 +103,10 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }}

- name: Setting secrets
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}

- name: Install Python client
run: .github/workflows/scripts/install_python_client.sh
shell: bash
Expand All @@ -128,39 +122,28 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}

- name: Upload python client packages
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
uses: actions/upload-artifact@v3
with:
name: python-client.tar
path: python-client.tar
name: "python-client.tar"
path: "pulp_gem/python-client.tar"

- name: Upload python client docs
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
uses: actions/upload-artifact@v3
with:
name: python-client-docs.tar
path: python-client-docs.tar

- name: Upload ruby client packages
if: ${{ env.TEST == 'bindings' || env.TEST == 'generate-bindings' }}
uses: actions/upload-artifact@v3
with:
name: ruby-client.tar
path: ruby-client.tar
name: "python-client-docs.tar"
path: "pulp_gem/python-client-docs.tar"
- name: Upload built docs
if: ${{ env.TEST == 'docs' }}
uses: actions/upload-artifact@v3
with:
name: docs.tar
path: docs/docs.tar
name: "docs.tar"
path: "pulp_gem/docs/docs.tar"

- name: Logs
if: always()
Expand All @@ -180,6 +163,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: "pulp_gem"

- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -207,6 +191,7 @@ jobs:
body: ''
branch: 'changelog/update'
delete-branch: true
path: "pulp_gem"

publish:
runs-on: ubuntu-latest
Expand All @@ -219,11 +204,18 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: "pulp_gem"

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

- uses: actions/download-artifact@v3
with:
name: plugin_package
path: dist/
name: "plugin_package"
path: "pulp_gem/dist/"

- uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -256,10 +248,6 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}

Expand All @@ -269,10 +257,6 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}

Expand All @@ -290,29 +274,27 @@ jobs:
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }}
GITHUB_BRANCH: ${{ github.head_ref }}
GITHUB_REPO_SLUG: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
REDIS_DISABLED: ${{ contains('', matrix.env.TEST) }}

- name: Setting secrets
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}


- name: Download built docs
uses: actions/download-artifact@v3
with:
name: docs.tar
name: "docs.tar"
path: "pulp_gem/docs.tar"

- name: Download Python client docs
uses: actions/download-artifact@v3
with:
name: python-client-docs.tar
name: "python-client-docs.tar"
path: "pulp_gem/python-client-docs.tar"

- name: Setting secrets
run: python3 .github/workflows/scripts/secrets.py "$SECRETS_CONTEXT"
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}

- name: Publish docs to pulpproject.org
run: |
Expand Down
Loading

0 comments on commit 675ee02

Please sign in to comment.