|
| 1 | +name: Test |
| 2 | + |
| 3 | +# Replaces the former AppVeyor (Windows) and GitLab CI (Linux) pipelines: |
| 4 | +# build + run the full Go and Cucumber suites on both platforms. |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [v3] |
| 9 | + pull_request: |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: read |
| 13 | + |
| 14 | +jobs: |
| 15 | + linux: |
| 16 | + name: Test (Linux) |
| 17 | + runs-on: ubuntu-latest |
| 18 | + env: |
| 19 | + CGO_ENABLED: "1" # required for the tree-sitter parsers |
| 20 | + BUNDLE_GEMFILE: ${{ github.workspace }}/testdata/Gemfile |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v5 |
| 23 | + with: |
| 24 | + fetch-depth: 0 # tags, for the version ldflag in `make build` |
| 25 | + |
| 26 | + - uses: actions/setup-go@v6 |
| 27 | + with: |
| 28 | + go-version: "1.25.7" |
| 29 | + |
| 30 | + - uses: ruby/setup-ruby@v1 |
| 31 | + with: |
| 32 | + ruby-version: "3.3" |
| 33 | + |
| 34 | + - uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: "20" |
| 37 | + |
| 38 | + - uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: "3.x" |
| 41 | + |
| 42 | + - uses: actions/setup-java@v4 |
| 43 | + with: |
| 44 | + distribution: temurin |
| 45 | + java-version: "17" |
| 46 | + |
| 47 | + - name: Install documentation toolchain |
| 48 | + run: | |
| 49 | + sudo apt-get -qq update |
| 50 | + sudo apt-get install -y xsltproc |
| 51 | + python -m pip install --upgrade docutils sphinx # rst2html |
| 52 | + gem install asciidoctor |
| 53 | + npm install -g mdx2vast |
| 54 | + curl -fsSL -o dita-ot-3.6.zip \ |
| 55 | + https://github.com/dita-ot/dita-ot/releases/download/3.6/dita-ot-3.6.zip |
| 56 | + unzip -q dita-ot-3.6.zip |
| 57 | + echo "$PWD/dita-ot-3.6/bin" >> "$GITHUB_PATH" |
| 58 | +
|
| 59 | + - name: Setup (bundle install) |
| 60 | + run: make setup |
| 61 | + |
| 62 | + - name: Build |
| 63 | + run: make build os=linux exe=vale |
| 64 | + |
| 65 | + - name: Test |
| 66 | + run: | |
| 67 | + export PATH="$PWD/bin:$PATH" |
| 68 | + make test |
| 69 | +
|
| 70 | + windows: |
| 71 | + name: Test (Windows) |
| 72 | + runs-on: windows-latest |
| 73 | + defaults: |
| 74 | + run: |
| 75 | + shell: bash # use the runner's Git bash for all steps |
| 76 | + env: |
| 77 | + CGO_ENABLED: "1" # required for the tree-sitter parsers |
| 78 | + BUNDLE_GEMFILE: ${{ github.workspace }}/testdata/Gemfile |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v5 |
| 81 | + with: |
| 82 | + fetch-depth: 0 |
| 83 | + |
| 84 | + - uses: actions/setup-go@v6 |
| 85 | + with: |
| 86 | + go-version: "1.25.7" |
| 87 | + |
| 88 | + - uses: ruby/setup-ruby@v1 |
| 89 | + with: |
| 90 | + ruby-version: "3.3" |
| 91 | + |
| 92 | + - uses: actions/setup-node@v4 |
| 93 | + with: |
| 94 | + node-version: "20" |
| 95 | + |
| 96 | + - uses: actions/setup-python@v5 |
| 97 | + with: |
| 98 | + python-version: "3.x" |
| 99 | + |
| 100 | + - uses: actions/setup-java@v4 |
| 101 | + with: |
| 102 | + distribution: temurin |
| 103 | + java-version: "17" |
| 104 | + |
| 105 | + - name: Install documentation toolchain |
| 106 | + run: | |
| 107 | + choco install --no-progress -y xsltproc |
| 108 | + # Git ships a non-functional xsltproc; drop it so the choco one wins. |
| 109 | + rm -f "/c/Program Files/Git/usr/bin/xsltproc.exe" || true |
| 110 | + python -m pip install --upgrade docutils sphinx # rst2html |
| 111 | + gem install asciidoctor |
| 112 | + npm install -g mdx2vast |
| 113 | + curl -fsSL -o dita-ot-3.6.zip \ |
| 114 | + https://github.com/dita-ot/dita-ot/releases/download/3.6/dita-ot-3.6.zip |
| 115 | + unzip -q dita-ot-3.6.zip |
| 116 | + echo "$PWD/dita-ot-3.6/bin" >> "$GITHUB_PATH" |
| 117 | +
|
| 118 | + - name: Setup (bundle install) |
| 119 | + run: cd testdata && bundle install |
| 120 | + |
| 121 | + - name: Build |
| 122 | + run: go build -o bin/vale.exe ./cmd/vale |
| 123 | + |
| 124 | + - name: Test |
| 125 | + run: | |
| 126 | + export PATH="$PWD/bin:$PATH" |
| 127 | + go test ./internal/core ./internal/lint ./internal/check ./internal/nlp ./internal/glob ./cmd/vale |
| 128 | + cd testdata && cucumber --format progress |
0 commit comments