Files
actions-codespell/.github/workflows/testing.yml
Peter Newman de089481bd Update README (#30)
* Update README

Add more parameters already in actions.yml

* Add note about case sensitivity of words to actions.yml

* Switch to a deliberate typo we're already using

* Check our README separately ignoring the two intentional typos

* Self censor ourselves!
2021-04-27 11:01:06 -04:00

108 lines
3.6 KiB
YAML

name: Testing
on: [push, pull_request]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
codespell_pip_version: ['codespell']
experimental: [false]
include:
- codespell_pip_version: 'git+https://github.com/codespell-project/codespell.git'
# Set this to true if git master is breaking the action's tests
experimental: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install codespell via pip using ${{ matrix.codespell_pip_version }}
run: pip3 --quiet --quiet install ${{ matrix.codespell_pip_version }}
- name: Install Bats
run: |
git clone --quiet https://github.com/bats-core/bats-core.git
cd bats-core
git fetch --tags
# Checkout the latest tag
git checkout --quiet $(git describe --tags `git rev-list --tags --max-count=1`)
sudo ./install.sh "/usr/local" > /dev/null
- name: Run Bats tests
run: bats "./test"
run_action:
name: Test run action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
path: test/testdata
only_warn: 1
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
with:
check_filenames: true
check_hidden: true
# When using this Action in other repos, the --skip option below can be removed
skip: ./.git,./codespell-problem-matcher/test,./test,./README.md,./.github/workflows/testing.yml
# Check our README (and this workflow) ignoring the two intentional typos
- uses: ./
with:
check_filenames: true
check_hidden: true
path: ./README.md,./.github/workflows/testing.yml
ignore_words_list: abandonned,ackward
diagnose_bats:
name: Diagnose bats
needs: test
if: always() && needs.test.result == 'failure'
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
codespell_pip_version: ['codespell']
include:
- codespell_pip_version: 'git+https://github.com/codespell-project/codespell.git'
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v2
- run: pip3 --quiet --quiet install ${{ matrix.codespell_pip_version }}
- run: |
# Simulate the Dockerfile COPY command
[ -d "${RUNNER_TEMP}/code/" ] || sudo mkdir -p ${RUNNER_TEMP}/code/
[ -f "${RUNNER_TEMP}/code/codespell-matcher.json" ] || sudo cp codespell-problem-matcher/codespell-matcher.json ${RUNNER_TEMP}/code/
#ls -alR ${RUNNER_TEMP}/code/
[ -d "/code/" ] || sudo mkdir -p /code/
[ -f "/code/codespell-matcher.json" ] || sudo cp codespell-problem-matcher/codespell-matcher.json /code/
#ls -alR /code/
# Add a random place BATS tries to put it
[ -d "/github/workflow/" ] || sudo mkdir -p /github/workflow/ && sudo chmod 777 /github/workflow/
#ls -alR /github/workflow/
export INPUT_CHECK_FILENAMES=""
export INPUT_CHECK_HIDDEN=""
export INPUT_EXCLUDE_FILE=""
export INPUT_SKIP=""
export INPUT_IGNORE_WORDS_FILE="./test/ignore-words-file.txt"
export INPUT_IGNORE_WORDS_LIST=""
export INPUT_PATH="./test/testdata"
export INPUT_ONLY_WARN=""
./entrypoint.sh || echo $?