diff options
author | Adam Warner <me@adamwarner.co.uk> | 2022-09-26 22:00:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 22:00:27 +0300 |
commit | 1b0b0ca44515cf65c288af06032b8608752ee7c2 (patch) | |
tree | 5f8c47cfc1250035d2f06c54fa8f237a08e53627 /.github | |
parent | f8a12917e2549f2070380053c7fc553f60e77101 (diff) | |
parent | e1a2591c4d76c8f6817cd2924757dfe61895bbe1 (diff) |
Update python tests and add black code formatter action (#4926)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/test.yml | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7725ecc3..442f1c0d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,29 +12,33 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - - name: Checkout repository - uses: actions/checkout@v3.0.2 - - - name: Check scripts in repository are executable - run: | - IFS=$'\n'; - for f in $(find . -name '*.sh'); do if [[ ! -x $f ]]; then echo "$f is not executable" && FAIL=1; fi ;done - unset IFS; - # If FAIL is 1 then we fail. - [[ $FAIL == 1 ]] && exit 1 || echo "Scripts are executable!" - - - name: Spell-Checking - uses: codespell-project/actions-codespell@master - with: - ignore_words_file: .codespellignore - - - name: Get editorconfig-checker - uses: editorconfig-checker/action-editorconfig-checker@main # tag v1.0.0 is really out of date - - - name: Run editorconfig-checker - run: editorconfig-checker + - name: Checkout repository + uses: actions/checkout@v3.0.2 + - name: Check scripts in repository are executable + run: | + IFS=$'\n'; + for f in $(find . -name '*.sh'); do if [[ ! -x $f ]]; then echo "$f is not executable" && FAIL=1; fi ;done + unset IFS; + # If FAIL is 1 then we fail. + [[ $FAIL == 1 ]] && exit 1 || echo "Scripts are executable!" + + - name: Spell-Checking + uses: codespell-project/actions-codespell@master + with: + ignore_words_file: .codespellignore + + - name: Get editorconfig-checker + uses: editorconfig-checker/action-editorconfig-checker@main # tag v1.0.0 is really out of date + + - name: Run editorconfig-checker + run: editorconfig-checker + + - name: Check python code formatting with black + uses: psf/black@stable + with: + src: "./test" + options: "--check --diff --color" distro-test: if: github.event.pull_request.draft == false @@ -43,21 +47,21 @@ jobs: strategy: fail-fast: false matrix: - distro: [debian_10, debian_11, ubuntu_20, ubuntu_22, centos_8, fedora_34] + distro: + [debian_10, debian_11, ubuntu_20, ubuntu_22, centos_8, fedora_34] env: DISTRO: ${{matrix.distro}} steps: - - - name: Checkout repository - uses: actions/checkout@v3.0.2 - - - name: Set up Python 3.10 - uses: actions/setup-python@v4.2.0 - with: - python-version: '3.10' - - - name: Install dependencies - run: pip install -r test/requirements.txt - - - name: Test with tox - run: tox -c test/tox.${DISTRO}.ini + - name: Checkout repository + uses: actions/checkout@v3.0.2 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4.2.0 + with: + python-version: "3.10" + + - name: Install dependencies + run: pip install -r test/requirements.txt + + - name: Test with tox + run: tox -c test/tox.${DISTRO}.ini |