diff --git a/.github/stale.yml b/.github/stale.yml index 214f70bf..d6a5be74 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 158e6b4a..6559d906 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05e419f0..6fe4b313 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -31,50 +30,52 @@ 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 + - name: "Create working directory" 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() + mkdir -p "pulp_catdog" + with: + working-directory: "." + - name: "Download Deprecations" + uses: actions/download-artifact@v3 + with: + name: "deprecations" + path: "pulp_catdog" + - 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:]]' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e1bef3c2..601479e3 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -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 diff --git a/.github/workflows/kanban.yml b/.github/workflows/kanban.yml index a884dbfc..1baeb97e 100644 --- a/.github/workflows/kanban.yml +++ b/.github/workflows/kanban.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 10206818..dc1f3bd5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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" @@ -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: | diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 9ab90ca9..20eb115e 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 606f11a8..e0e04ea8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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" @@ -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 @@ -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"