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 28, 2023
1 parent 959cc3b commit 874578b
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 84 deletions.
16 changes: 0 additions & 16 deletions .ci/scripts/tweet.py

This file was deleted.

2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-278-g22c5b00
2021.08.26-280-geee4b32-dirty
49 changes: 24 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# For more info visit https://github.com/pulp/plugin_template

---
name: Gem CI
name: "Gem CI"
on: {pull_request: {branches: ['*']}}

concurrency:
Expand All @@ -18,9 +18,8 @@ defaults:
working-directory: "pulp_gem"

jobs:

ready-to-ship:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -29,48 +28,48 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- 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"
if: github.event_name == 'pull_request'
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
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:]]'
12 changes: 0 additions & 12 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,3 @@ jobs:
run: |
tar -xvf docs.tar -C ./docs
.github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/}
- 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"
13 changes: 3 additions & 10 deletions .github/workflows/scripts/check_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
# For more info visit https://github.com/pulp/plugin_template

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

set -euv

echo ::group::REQUESTS
pip3 install requests

pip3 install pygithub

echo ::endgroup::

for sha in $(curl -H "Authorization: token $GITHUB_TOKEN" $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
for SHA in $(curl -H "Authorization: token $GITHUB_TOKEN" "$GITHUB_CONTEXT" | jq -r '.[].sha')
do
python3 .ci/scripts/validate_commit_message.py $sha
python3 .ci/scripts/validate_commit_message.py "$SHA"
VALUE=$?
if [ "$VALUE" -gt 0 ]; then
exit $VALUE
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/scripts/create_release_from_tag.sh

This file was deleted.

19 changes: 11 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ jobs:
- TEST: azure
- 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
Expand Down Expand Up @@ -113,9 +108,17 @@ jobs:
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
- 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_gem/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
2 changes: 1 addition & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

# generated with [email protected]277-gb3d1884
# generated with [email protected]279-gea3c2fb

additional_repos: []
api_root: /pulp/
Expand Down

0 comments on commit 874578b

Please sign in to comment.