From 36d57df6f54e5e1726b84aac7e63260323847d25 Mon Sep 17 00:00:00 2001 From: James Faeldon <111378+altcoder@users.noreply.github.com> Date: Fri, 9 Feb 2024 12:46:32 +0800 Subject: [PATCH] refactor: added recommended github actions --- .github/CODE_OF_CONDUCT.md | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/renovate.json | 2 +- .github/workflows/build.yml | 5 +-- .github/workflows/check-pr.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release.yml | 11 +++++- .github/workflows/reviewdog.yml | 46 +++++++++++++++++++++++ .github/workflows/sched-template-sync.yml | 8 ++-- .github/workflows/sphinx.yml | 2 +- .vscode/launch.json | 2 +- 11 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 073dd58..67fe8ce 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -129,4 +129,4 @@ For answers to common questions about this code of conduct, see the FAQ at [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations \ No newline at end of file +[translations]: https://www.contributor-covenant.org/translations diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3600098..5f28255 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,4 +20,4 @@ If applicable, add screenshots to help explain your problem. ## Versions - Python: -- Spark: \ No newline at end of file +- Spark: diff --git a/.github/renovate.json b/.github/renovate.json index c602bf7..d8a4e29 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -5,4 +5,4 @@ "labels": [ "bump:patch" ] -} \ No newline at end of file +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68cec51..e7b0602 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - -name: Python Build Workflow +name: build on: push: diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index a5e349f..21df8d3 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -1,4 +1,4 @@ -name: "Semantic PR Check" +name: check-pr on: pull_request_target: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 79b9a36..b8bbf77 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Python Publish Workflow +name: publish on: workflow_call: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54219f8..7886ba5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,14 @@ -name: Python Release Workflow +name: release on: workflow_call: - + push: + branches: + - main + tags: + - 'v*.*.*' + pull_request: + types: + - labeled jobs: release: uses: altcoder/action-python/.github/workflows/release.yml@v0.1 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml new file mode 100644 index 0000000..fbc26b9 --- /dev/null +++ b/.github/workflows/reviewdog.yml @@ -0,0 +1,46 @@ +name: reviewdog +on: + push: + branches: + - main + pull_request: +jobs: + shellcheck: + name: runner / shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: haya14busa/action-cond@v1 + id: reporter + with: + cond: ${{ github.event_name == 'pull_request' }} + if_true: "github-pr-review" + if_false: "github-check" + - uses: reviewdog/action-shellcheck@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: ${{ steps.reporter.outputs.value }} + level: warning + + misspell: + name: runner / misspell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: reviewdog/action-misspell@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-check + level: warning + locale: "US" + + alex: + name: runner / alex + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: reviewdog/action-alex@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-check + level: warning diff --git a/.github/workflows/sched-template-sync.yml b/.github/workflows/sched-template-sync.yml index 77183a6..32d8032 100644 --- a/.github/workflows/sched-template-sync.yml +++ b/.github/workflows/sched-template-sync.yml @@ -1,7 +1,7 @@ -name: Template Sync +name: sched-template-sync on: - # cronjob trigger + # cronjob trigger schedule: - cron: "0 0 1 * *" # manual trigger @@ -18,14 +18,14 @@ jobs: steps: # To use this repository's private action, you must check out the repository - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 # https://github.com/actions/checkout#usage # uncomment if you use submodules within the source repository # with: # submodules: true - name: actions-template-sync - uses: AndreasAugustin/actions-template-sync@v1.4.0 + uses: AndreasAugustin/actions-template-sync@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} source_repo_path: altcoder/template-python diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index d8498e6..fcfcea6 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,4 +1,4 @@ -name: Deploy Sphinx documentation to Pages +name: sphinx on: push: diff --git a/.vscode/launch.json b/.vscode/launch.json index 7a01441..8524bf8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -16,4 +16,4 @@ } } ] -} \ No newline at end of file +}