Skip to content

Commit

Permalink
Fix script in release workflow
Browse files Browse the repository at this point in the history
While at it added yamllint to find at least some issues with the
workflow files early.

[noissue]
  • Loading branch information
mdellweg committed Nov 27, 2023
1 parent b3d1884 commit 5cf7e81
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ jobs:
- name: Install requirements
run: pip3 install -r lint_requirements.txt

- name: Lint workflow files
run: |
yamllint -d relaxed .github/workflows

Check warning on line 50 in .github/workflows/lint.yml

View workflow job for this annotation

GitHub Actions / lint / lint

50:81 [line-length] line too long (145 > 80 characters)
# run black separately from flake8 to get a diff
- name: Run black
run: |
Expand Down
12 changes: 8 additions & 4 deletions templates/github/.github/workflows/ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ defaults:
working-directory: "{{ plugin_name }}"

jobs:
{% if pre_job_template -%}{{ " " | indent }}{% include pre_job_template.path %}{%- endif %}

{%- if pre_job_template %}
{% include pre_job_template.path %}
{%- endif %}
{%- if check_commit_message or lint_requirements %}

ready-to-ship:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -56,8 +58,8 @@ jobs:
test:
needs: build
uses: "./.github/workflows/test.yml"

{%- if test_deprecations %}

deprecations:
defaults:
run:
Expand Down Expand Up @@ -93,4 +95,6 @@ jobs:
{%- endif %}
{%- endif %}

{% if post_job_template -%}{{ " " | indent }}{% include post_job_template.path %}{%- endif %}
{%- if post_job_template %}
{% include post_job_template.path %}
{%- endif %}
16 changes: 8 additions & 8 deletions templates/github/.github/workflows/codeql-analysis.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,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 templates/github/.github/workflows/kanban.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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
14 changes: 9 additions & 5 deletions templates/github/.github/workflows/lint.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,39 @@ jobs:
- name: Install requirements
run: pip3 install -r lint_requirements.txt

{% if black -%}
- name: Lint workflow files
run: |
yamllint -s -d '{extends: relaxed, rules: {line-length: disable}}' .github/workflows
{%- if black %}

# run black separately from flake8 to get a diff
- name: Run black
run: |
black --version
black --check --diff .
{%- endif %}
{%- if flake8 %}

{% if flake8 -%}
# Lint code.
- name: Run flake8
run: flake8
{%- endif %}

- name: Run extra lint checks
run: "[ ! -x .ci/scripts/extra_linting.sh ] || .ci/scripts/extra_linting.sh"
{%- if check_manifest -%}

{% if check_manifest -%}
# check for any files unintentionally left out of MANIFEST.in
- name: Check manifest
run: check-manifest
{%- endif %}
{%- if check_stray_pulpcore_imports %}

{% if check_stray_pulpcore_imports -%}
- name: Check for pulpcore imports outside of pulpcore.plugin
run: sh .ci/scripts/check_pulpcore_imports.sh
{%- endif %}
{%- if check_gettext %}

{% if check_gettext -%}
- name: Check for gettext problems
run: sh .ci/scripts/check_gettext.sh
{%- endif %}
4 changes: 2 additions & 2 deletions templates/github/.github/workflows/nightly.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ jobs:
{{ setup_python() | indent(6) }}

{{ setup_env() | indent(6) }}
{%- if publish_docs_to_pulpprojectdotorg and docs_test %}

{% if publish_docs_to_pulpprojectdotorg and docs_test %}
- name: Download built docs
uses: actions/download-artifact@v3
with:
Expand All @@ -97,7 +97,7 @@ jobs:
run: |
tar -xvf docs.tar -C ./docs
.github/workflows/scripts/publish_docs.sh nightly ${GITHUB_REF##*/}
{% endif %}
{%- endif %}

{{ display_logs() | indent(6) }}

Expand Down
4 changes: 2 additions & 2 deletions templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,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,
Expand Down
10 changes: 5 additions & 5 deletions templates/github/.github/workflows/update-labels.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
with context %}

---
name: {{ plugin_app_label | camel }} Update Labels
name: "{{ plugin_app_label | camel }} Update Labels"
on:
push:
branches:
- main
- "main"
paths:
- 'template_config.yml'
- "template_config.yml"

jobs:
update_backport_labels:
Expand All @@ -21,8 +21,8 @@ jobs:
{{ setup_python() | indent(6) }}
{{ configure_git() | indent(6) }}
{{ install_python_deps("requests pyyaml") | indent(6) }}
- uses: actions/checkout@v3
- name: Update labels
- uses: "actions/checkout@v3"
- name: "Update labels"
run: |
python3 .github/workflows/scripts/update_backport_labels.py
env:
Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/update_ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ 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'
{% endif %}
{%- endif %}
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions templates/github/lint_requirements.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ flake8
{% if black -%}
flake8-black
{% endif -%}
yamllint

0 comments on commit 5cf7e81

Please sign in to comment.