-
Notifications
You must be signed in to change notification settings - Fork 19
112 lines (101 loc) · 3.7 KB
/
testing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install codespell via pip using ${{ matrix.codespell_pip_version }}
run: pip install ${{ matrix.codespell_pip_version }}
- name: Check codespell
run: codespell --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@v3
- uses: ./
with:
path: test/testdata
only_warn: 1
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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@v3
- name: Set up Python
uses: actions/setup-python@v4
- 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 $?