From da3b44829458aff758034058711559a18ddbcecb Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 16 Nov 2023 15:27:06 +0100 Subject: [PATCH] Experiment: Update CI [noissue] --- .ci/scripts/tweet.py | 16 ---------------- .github/template_gitref | 2 +- .github/workflows/ci.yml | 19 +++++++++---------- .github/workflows/codeql-analysis.yml | 16 ++++++++-------- .github/workflows/kanban.yml | 2 +- .github/workflows/lint.yml | 4 ++++ .github/workflows/nightly.yml | 14 ++++++-------- .github/workflows/release.yml | 4 ++-- .../scripts/create_release_from_tag.sh | 11 ----------- .github/workflows/update-labels.yml | 10 +++++----- .github/workflows/update_ci.yml | 1 - lint_requirements.txt | 2 +- template_config.yml | 2 -- 13 files changed, 37 insertions(+), 66 deletions(-) delete mode 100755 .ci/scripts/tweet.py delete mode 100755 .github/workflows/scripts/create_release_from_tag.sh diff --git a/.ci/scripts/tweet.py b/.ci/scripts/tweet.py deleted file mode 100755 index 641e192..0000000 --- a/.ci/scripts/tweet.py +++ /dev/null @@ -1,16 +0,0 @@ -import os -import sys -from tweepy import Client - -release_version = sys.argv[1] -if release_version.endswith(".0"): - client = Client( - consumer_key=os.getenv("TWITTER_API_KEY"), - consumer_secret=os.getenv("TWITTER_API_KEY_SECRET"), - access_token=os.getenv("TWITTER_ACCESS_TOKEN"), - access_token_secret=os.getenv("TWITTER_ACCESS_TOKEN_SECRET"), - ) - link = "https://docs.pulpproject.org/pulp_gem/changes.html" - msg = f"pulp_gem-{release_version} - Check out for more details: {link}" - release_msg = f"Hey! We've just released {msg}" - client.create_tweet(text=release_msg) diff --git a/.github/template_gitref b/.github/template_gitref index 4ff7980..de6c132 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-277-gb3d1884 +2021.08.26-278-g22c5b00-dirty diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a5d79d..a94ea30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,7 @@ jobs: test: needs: build uses: "./.github/workflows/test.yml" + deprecations: defaults: run: @@ -62,16 +63,14 @@ jobs: 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 }}" + test -z "${{ needs.test.test.outputs.deprecations-pulp }}" + test -z "${{ needs.test.test.outputs.deprecations-azure }}" + test -z "${{ needs.test.test.outputs.deprecations-s3 }}" + test -z "${{ needs.test.test.outputs.deprecations-lowerbounds }}" - name: Print deprecations if: failure() 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 - - + echo "${{ needs.test.test.outputs.deprecations-pulp }}" | base64 -d + echo "${{ needs.test.test.outputs.deprecations-azure }}" | base64 -d + echo "${{ needs.test.test.outputs.deprecations-s3 }}" | base64 -d + echo "${{ needs.test.test.outputs.deprecations-lowerbounds }}" | base64 -d diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9306066..6becf3f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,13 +30,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 diff --git a/.github/workflows/kanban.yml b/.github/workflows/kanban.yml index 1e99b73..3c154c8 100644 --- a/.github/workflows/kanban.yml +++ b/.github/workflows/kanban.yml @@ -58,7 +58,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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index be839a8..2db66c6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,6 +32,10 @@ jobs: - name: Install requirements run: pip3 install -r lint_requirements.txt + - name: Lint workflow files + run: | + yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows + # run black separately from flake8 to get a diff - name: Run black run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 23597e3..bc85f36 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -76,12 +76,6 @@ jobs: 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" @@ -91,11 +85,16 @@ jobs: with: python-version: "3.8" + - name: Install python dependencies + run: | + echo ::group::PYDEPS + pip install requests + echo ::endgroup:: + - name: Set environment variables run: | echo "TEST=${{ matrix.env.TEST }}" >> $GITHUB_ENV - - name: Download built docs uses: actions/download-artifact@v3 with: @@ -117,7 +116,6 @@ jobs: run: | tar -xvf docs.tar -C ./docs .github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/} - - name: Logs if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce0ba40..a8730e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -268,9 +268,9 @@ jobs: env: TAG_NAME: ${{ inputs.release }} with: - const { TAG_NAME } = process.env; - script: | + const { TAG_NAME } = process.env; + await github.rest.repos.createRelease({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/workflows/scripts/create_release_from_tag.sh b/.github/workflows/scripts/create_release_from_tag.sh deleted file mode 100755 index 4de7777..0000000 --- a/.github/workflows/scripts/create_release_from_tag.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -set -eu - -curl -s -X "POST https://api.github.com/repos/$GITHUB_REPOSITORY/releases" \ --H "Authorization: token $RELEASE_TOKEN" \ --d @- << EOF -{ - "tag_name": "$1", - "name": "$1" -} -EOF diff --git a/.github/workflows/update-labels.yml b/.github/workflows/update-labels.yml index 8c5233b..95596d9 100644 --- a/.github/workflows/update-labels.yml +++ b/.github/workflows/update-labels.yml @@ -7,13 +7,13 @@ --- -name: Gem Update Labels +name: "Gem Update Labels" on: push: branches: - - main + - "main" paths: - - 'template_config.yml' + - "template_config.yml" jobs: update_backport_labels: @@ -31,8 +31,8 @@ jobs: echo ::group::PYDEPS pip install requests pyyaml echo ::endgroup:: - - uses: actions/checkout@v3 - - name: Update labels + - uses: "actions/checkout@v3" + - name: "Update labels" run: | python3 .github/workflows/scripts/update_backport_labels.py env: diff --git a/.github/workflows/update_ci.yml b/.github/workflows/update_ci.yml index 9b0e109..f521c81 100644 --- a/.github/workflows/update_ci.yml +++ b/.github/workflows/update_ci.yml @@ -13,7 +13,6 @@ on: # * is a special character in YAML so you have to quote this string # runs at 2:30 UTC every Sunday - cron: '30 2 * * 0' - workflow_dispatch: jobs: diff --git a/lint_requirements.txt b/lint_requirements.txt index 20e80ce..94dbbc8 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -10,4 +10,4 @@ black check-manifest flake8 flake8-black - +yamllint diff --git a/template_config.yml b/template_config.yml index 0372c5a..ac3a6b3 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,8 +1,6 @@ # 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 plugin_template@2021.08.26-277-gb3d1884 - additional_repos: [] api_root: /pulp/ black: true