Skip to content

Commit 4e1cc32

Browse files
committed
[#164] Add workflow for running Windows tests on CI
Problem: we are not testing behavior of xrefcheck on Windows Solution: test locally and add workflow to run golden and tasty tests on CI via github-actions windows runner
1 parent 9b70282 commit 4e1cc32

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

.github/workflows/ci.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# SPDX-FileCopyrightText: 2020 Kowainik
2+
# SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io/>
3+
#
4+
# SPDX-License-Identifier: MPL-2.0
5+
6+
# Sources:
7+
# • https://github.com/kowainik/validation-selective/blob/5b46cd4810bbaa09b704062ebbfa2bb47137425d/.github/workflows/ci.yml
8+
# • https://kodimensional.dev/github-actions
9+
# • https://github.com/serokell/tztime/blob/336f585c2c7125a8ba58ffbf3dbea4f36a7c40e7/.github/workflows/ci.yml
10+
11+
name: CI
12+
13+
on: [pull_request, push]
14+
15+
jobs:
16+
xrefcheck-build-and-test:
17+
runs-on: windows-latest
18+
strategy:
19+
matrix:
20+
stack: ["2.9.1"]
21+
ghc: ["9.0.2"]
22+
include:
23+
- ghc: "9.0.2"
24+
stackyaml: stack.yaml
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- uses: haskell/actions/[email protected]
29+
name: Setup Haskell Stack
30+
with:
31+
ghc-version: ${{ matrix.ghc }}
32+
stack-version: ${{ matrix.stack }}
33+
34+
- uses: actions/cache@v3
35+
name: Cache ~/.stack
36+
with:
37+
path: ~/.stack
38+
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
39+
40+
- name: install pacman dependencies
41+
run:
42+
stack --system-ghc exec export XDG_DATA_DIRS=/mingw64/share;
43+
stack --system-ghc exec export PKG_CONFIG_PATH=/mingw64/bin/pkg-config;
44+
stack --system-ghc exec -- pacman --noconfirm -Syuu;
45+
stack --system-ghc exec -- pacman --noconfirm -Syuu;
46+
stack --system-ghc exec -- pacman -S --noconfirm msys2-keyring;
47+
stack --system-ghc exec -- pacman -S --noconfirm pkgconf;
48+
stack --system-ghc exec -- pacman -S --noconfirm mingw-w64-x86_64-pcre;
49+
stack --system-ghc exec -- pacman -S pcre;
50+
stack --system-ghc exec -- pacman -S pcre-devel;
51+
stack --system-ghc install regex-pcre
52+
53+
54+
55+
- name: Build
56+
run: |
57+
stack build --system-ghc --stack-yaml ${{ matrix.stackyaml }} --test --bench --no-run-tests --no-run-benchmarks --ghc-options '-Werror' --haddock --no-haddock-deps
58+
59+
- name: stack test xrefcheck:xrefcheck-tests
60+
run: |
61+
stack test --system-ghc --stack-yaml ${{ matrix.stackyaml }}
62+
xrefcheck:xrefcheck-tests
63+
64+
# commented to cache .stack (golden tests are not passing yet)
65+
# - uses: mig4/setup-bats@v1
66+
# name: Setup bats
67+
# - name: Golden tests
68+
# run: bats ./tests/golden/**

src/Xrefcheck/Core.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Data.Map qualified as M
2121
import Data.Text qualified as T
2222
import Fmt (Buildable (..), blockListF, blockListF', nameF, (+|), (|+))
2323
import System.Console.Pretty (Color (..), Style (..), color, style)
24-
import System.FilePath (isPathSeparator, pathSeparator)
24+
import System.FilePath (isPathSeparator)
2525
import Text.Numeral.Roman (toRoman)
2626
import Time (Second, Time)
2727

@@ -295,7 +295,7 @@ canonizeLocalRef :: Text -> Text
295295
canonizeLocalRef ref =
296296
maybe ref canonizeLocalRef (T.stripPrefix localPrefix ref)
297297
where
298-
localPrefix = toText ['.', pathSeparator]
298+
localPrefix = "./"
299299

300300
-----------------------------------------------------------
301301
-- Visualisation

0 commit comments

Comments
 (0)