-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (49 loc) · 1.46 KB
/
test.yml
File metadata and controls
60 lines (49 loc) · 1.46 KB
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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install pandoc
uses: pandoc/actions/setup@v1
- name: Show pandoc version
run: pandoc --version
- name: Run tests
run: ./tests/test_pandoc_format.sh
- name: Test with pre-commit
run: |
pip install pre-commit
# Create a test configuration that excludes test fixtures
cat > .pre-commit-test-config.yaml << 'EOF'
repos:
- repo: .
rev: HEAD
hooks:
- id: pandoc
exclude: ^tests/fixtures/
EOF
pre-commit run --config .pre-commit-test-config.yaml --all-files || true
# Run again to ensure idempotency
pre-commit run --config .pre-commit-test-config.yaml --all-files
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
shellcheck pandoc-format
shellcheck tests/test_pandoc_format.sh
- name: Check file permissions
run: |
test -x pandoc-format || (echo "pandoc-format is not executable" && exit 1)
test -x tests/test_pandoc_format.sh || (echo "test script is not executable" && exit 1)