Automated code review for "type-checking-decorator" #539
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2021 - 2023 Mewbot Developers <[email protected]> | |
# | |
# SPDX-License-Identifier: BSD-2-Clause | |
name: Auto-Review | |
run-name: "Automated code review for \"${{ github.head_ref }}\"" | |
on: | |
push: | |
branches: | |
- mainline | |
pull_request: # All pull requests | |
concurrency: | |
group: review-${{ github.head_ref }} | |
cancel-in-progress: true | |
env: | |
# Which version of the reports Sonar receives. | |
DEFAULT_OS: ubuntu | |
DEFAULT_PYTHON: "3.10" | |
jobs: | |
test: | |
name: ${{ matrix.name }} Python code (${{ matrix.os }}/py${{ matrix.version }}) | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
name: ["lint", "test"] | |
os: ["ubuntu", "macos", "windows"] | |
version: ["3.10", "3.11"] | |
exclude: | |
- name: Lint | |
os: macos | |
- name: Lint | |
os: windows | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.version }} | |
cache: pip | |
cache-dependency-path: | | |
requirements.txt | |
requirements-dev.txt | |
- name: Install dependencies | |
shell: bash | |
run: ./tools/install-deps | |
- name: Run Tests | |
shell: bash | |
run: ./tools/${{ matrix.name }} | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ matrix.name }}-results-${{ matrix.os }}-${{ matrix.version }} | |
path: reports | |
tests-passed: | |
name: Tests Passed | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: Mark all test runs as successful | |
run: /bin/true | |
annotate: | |
name: Output Annotations | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Python ${{ matrix.version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.version }} | |
cache: pip | |
cache-dependency-path: | | |
requirements.txt | |
requirements-dev.txt | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
if: always() | |
with: | |
path: reports | |
- name: Install dependencies | |
shell: bash | |
run: ./tools/install-deps | |
- name: Output Annotations | |
shell: bash | |
run: ./tools/annotate | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
if: always() | |
with: | |
name: lint-results-${{ env.DEFAULT_OS }}-${{ env.DEFAULT_PYTHON }} | |
path: reports | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
if: always() | |
with: | |
name: test-results-${{ env.DEFAULT_OS }}-${{ env.DEFAULT_PYTHON }} | |
path: reports | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
if: always() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |