Skip to content

Commit

Permalink
Adjust the local workflow files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Nov 28, 2023
1 parent 146b9c8 commit 720f438
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 108 deletions.
1 change: 0 additions & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ staleLabel: stale

# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
only: pulls

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
path: "plugin_template"
# We need the full history for bootstrapping
Expand All @@ -34,7 +34,7 @@ jobs:
# Below this line we include the steps of the ci workflow of the generated plugin

- name: Install python dependencies
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install packaging wheel
Expand Down
62 changes: 30 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ defaults:
working-directory: "pulp_catdog"

jobs:

ready-to-ship:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
path: "plugin_template"
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: "actions/setup-python@v4"
with:
python-version: "3.8"
- name: "Bootstrap catdog plugin"
Expand All @@ -31,50 +30,49 @@ jobs:
.ci/bootstrap_catdog.sh
# Below this line we include the steps of the ci workflow of the generated plugin
- name: Install requirements
run: pip3 install github
- name: Check commit message
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install requests pygithub
echo ::endgroup::
- name: "Check commit message"
# This will fail for our fake plugin
if: false
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: sh .github/workflows/scripts/check_commit.sh
- name: Verify requirements files
run: python .ci/scripts/check_requirements.py
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
run: |
.github/workflows/scripts/check_commit.sh
- name: "Verify requirements files"
run: |
python .ci/scripts/check_requirements.py
lint:
uses: "./.github/workflows/lint.yml"

build:
needs: lint
needs: "lint"
uses: "./.github/workflows/build.yml"

test:
needs: build
needs: "build"
uses: "./.github/workflows/test.yml"

deprecations:
defaults:
run:
working-directory: "."
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
if: github.base_ref == 'main'
needs: test
needs: "test"
steps:
- name: Fail on deprecations
run: |
test -z "${{ needs.test.outputs.deprecations-pulp }}"
test -z "${{ needs.test.outputs.deprecations-azure }}"
test -z "${{ needs.test.outputs.deprecations-s3 }}"
test -z "${{ needs.test.outputs.deprecations-lowerbounds }}"
- name: Print deprecations
if: failure()
- name: "Download Deprecations"
uses: actions/download-artifact@v3
with:
name: "deprecations"
- name: "Print deprecations"
run: |
echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d
echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d
echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d
echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d
cat deprecations-*.txt | sort -u
! cat deprecations-*.txt | grep '[^[:space:]]'
16 changes: 8 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion .github/workflows/kanban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
runs-on: ubuntu-latest
name: Find issues linked to a PR
outputs:
linked-issues: ${{ steps.linked-issues.outputs.issues }}
linked-issues: ${{ steps.linked-issues.outputs.issues }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
path: "plugin_template"
# We need the full history for bootstrapping
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: "actions/setup-python@v4"
with:
python-version: "3.8"
- name: "Lint plugin_template"
Expand All @@ -41,9 +41,11 @@ jobs:
# Below this line we include the steps of the ci workflow of the generated plugin

# lint_requirements contains tools needed for flake8, etc.
- name: Install requirements
run: pip3 install -r lint_requirements.txt
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install -r lint_requirements.txt
echo ::endgroup::
- name: Lint workflow files
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
- name: Commit Count Check
Expand Down
125 changes: 67 additions & 58 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,26 @@ jobs:
- TEST: gcp
- TEST: s3
- TEST: lowerbounds
outputs:
deprecations-pulp: ${{ steps.deprecations.outputs.deprecations-pulp }}
deprecations-azure: ${{ steps.deprecations.outputs.deprecations-azure }}
deprecations-s3: ${{ steps.deprecations.outputs.deprecations-s3 }}
deprecations-lowerbounds: ${{ steps.deprecations.outputs.deprecations-lowerbounds }}

steps:
- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
path: "plugin_template"
# We need the full history for bootstrapping
fetch-depth: 0

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

- name: Bootstrap catdog plugin
working-directory: plugin_template
- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
.ci/bootstrap_catdog.sh
# Below this line we include the steps of the ci workflow of the generated plugin

- uses: actions/checkout@v4
- uses: "actions/checkout@v4"
with:
fetch-depth: 1
repository: "pulp/pulp-openapi-generator"
Expand All @@ -62,69 +57,83 @@ jobs:
name: "plugin_package"
path: "pulp_catdog/dist/"

- name: Install httpie
- name: "Install python dependencies"
run: |
echo ::group::HTTPIE
pip install httpie
echo ::endgroup::
echo ::group::PYDEPS
pip install towncrier twine wheel httpie docker netaddr boto3 ansible
echo "HTTPIE_CONFIG_DIR=$GITHUB_WORKSPACE/pulp_catdog/.ci/assets/httpie/" >> $GITHUB_ENV
echo ::endgroup::
- name: Set environment variables
- name: "Set environment variables"
run: |
echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV
- name: Before Install
run: .github/workflows/scripts/before_install.sh
shell: bash
- 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 }}
PY_COLORS: "1"
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: .github/workflows/scripts/install.sh
shell: bash
- 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
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: Install Python client
run: .github/workflows/scripts/install_python_client.sh
shell: bash
- name: Install Ruby client
if: ${{ env.TEST == 'pulp' }}
run: .github/workflows/scripts/install_ruby_client.sh
shell: bash
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: "Install Python client"
run: |
.github/workflows/scripts/install_python_client.sh
shell: "bash"
- name: "Install Ruby client"
if: "${{ env.TEST == 'pulp' }}"
run: |
.github/workflows/scripts/install_ruby_client.sh
shell: "bash"

- name: Script
run: .github/workflows/scripts/script.sh
shell: bash
- name: "Script"
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: Extract Deprecations from Logs
id: deprecations
run: echo deprecations-${{ matrix.env.TEST }}=$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0) >> $GITHUB_OUTPUT
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"

- name: "Extract Deprecations from Logs"
run: |
docker logs pulp 2>&1 | grep -i pulpcore.deprecation | tee deprecations-${{ matrix.env.TEST }}.txt
- name: "Upload Deprecations"
uses: actions/upload-artifact@v3
with:
name: "deprecations"
path: "pulp_catdog/deprecations-${{ matrix.env.TEST }}.txt"
if-no-files-found: "error"
retention-days: 5
- name: Upload python client packages
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -157,7 +166,7 @@ jobs:
name: "docs.tar"
path: "pulp_catdog/docs/docs.tar"

- name: Logs
- name: "Logs"
if: always()
run: |
echo "Need to debug? Please check: https://github.com/marketplace/actions/debugging-with-tmate"
Expand Down

0 comments on commit 720f438

Please sign in to comment.