-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#164] Add workflow for running Windows tests on CI
Problem: we are not testing behavior of xrefcheck on Windows Solution: and add workflow to run golden and tasty tests on CI via github-actions windows runner Some subproblems appear: 1. Problem: CI build fails beacuse it needs `pcre` package Solution: add it (somehow), see `install pacman dependencies` in ci.yml 2. Problem: Network errors displayed different on different platforms Solution: collect output from both and use `assert_diff expected_linux.gold || assert_diff expected_windows.gold` 3: Problem: "Config matches" test is failing because checkout action clone files with CRLF, and test assert equality of two ByteStrings Solution: manually remove CR
- Loading branch information
1 parent
c1cd260
commit 6fa646f
Showing
7 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# SPDX-FileCopyrightText: 2020 Kowainik | ||
# SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io/> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
# Sources: | ||
# • https://github.com/kowainik/validation-selective/blob/5b46cd4810bbaa09b704062ebbfa2bb47137425d/.github/workflows/ci.yml | ||
# • https://kodimensional.dev/github-actions | ||
# • https://github.com/serokell/tztime/blob/336f585c2c7125a8ba58ffbf3dbea4f36a7c40e7/.github/workflows/ci.yml | ||
|
||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
xrefcheck-build-and-test: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
stack: ["2.7.5"] | ||
ghc: ["9.0.2"] | ||
include: | ||
- ghc: "9.0.2" | ||
stackyaml: stack.yaml | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'true' | ||
|
||
- uses: haskell/actions/[email protected] | ||
id: setup-haskell-stack | ||
name: Setup Haskell Stack | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
stack-version: ${{ matrix.stack }} | ||
|
||
- uses: actions/cache@v3 | ||
name: Cache stack root | ||
with: | ||
path: ~/AppData/Roaming/stack | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-stack | ||
|
||
- uses: actions/cache@v3 | ||
name: Cache AppData/Local/Programs/stack | ||
with: | ||
path: ~/AppData/Local/Programs/stack | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-appdata-stack | ||
|
||
|
||
# When editing this action, make sure it can run without using cached folders. | ||
# Yes, it tries to install mingw-w64-x86_64-pcre twice | ||
- name: install pacman dependencies | ||
run: | | ||
stack --system-ghc exec -- pacman -S --needed --noconfirm pkgconf; | ||
stack --system-ghc exec -- pacman -S --needed --noconfirm msys2-keyring; | ||
stack --system-ghc exec -- pacman --noconfirm -Syuu; | ||
stack --system-ghc exec -- pacman -S --needed --noconfirm mingw-w64-x86_64-pcre; | ||
stack --system-ghc exec -- pacman --noconfirm -Syuu; | ||
stack --system-ghc exec -- pacman -S --needed --noconfirm mingw-w64-x86_64-pcre; | ||
stack --system-ghc exec -- pacman -S --needed --noconfirm pcre-devel; | ||
- name: Build | ||
run: | | ||
stack build --system-ghc --stack-yaml ${{ matrix.stackyaml }} --test --bench --no-run-tests --no-run-benchmarks --ghc-options '-Werror' --haddock --no-haddock-deps | ||
- name: stack test xrefcheck:xrefcheck-tests | ||
run: | | ||
stack test --system-ghc --stack-yaml ${{ matrix.stackyaml }} xrefcheck:xrefcheck-tests | ||
- name: install xrefcheck to use with golden tests | ||
run: | | ||
stack --system-ghc --stack-yaml ${{ matrix.stackyaml }} install; | ||
- uses: mig4/setup-bats@v1 | ||
name: Setup bats | ||
|
||
- name: Golden tests | ||
run: | | ||
export PATH=$PATH:/c/Users/runneradmin/AppData/Roaming/local/bin; | ||
bats ./tests/golden/** | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
=== Invalid references found === | ||
|
||
➥ In file check-ignoreRefs.md | ||
bad reference (external) at src:7:10-53: | ||
- text: "web-site" | ||
- link: https://localhost:20000/web-site | ||
- anchor: - | ||
|
||
⛂ InternalException (HostCannotConnect "localhost" [Network.Socket.connect: <socket: N>: failed (Connection refused (WSAECONNREFUSED)),Network.Socket.connect: <socket: N>: failed (Connection refused (WSAECONNREFUSED))]) | ||
|
||
|
||
|
||
➥ In file check-ignoreRefs.md | ||
bad reference (external) at src:9:10-45: | ||
- text: "team" | ||
- link: https://127.0.0.1:20000/team | ||
- anchor: - | ||
|
||
⛂ InternalException (HostCannotConnect "127.0.0.1" [Network.Socket.connect: <socket: N>: failed (Connection refused (WSAECONNREFUSED))]) | ||
|
||
|
||
|
||
➥ In file check-ignoreRefs.md | ||
bad reference (external) at src:11:10-44: | ||
- text: "blog" | ||
- link: http://localhost:20000/blog | ||
- anchor: - | ||
|
||
⛂ ConnectionFailure Network.Socket.connect: <socket: N>: failed (Connection refused (WSAECONNREFUSED)) | ||
|
||
|
||
|
||
➥ In file check-ignoreRefs.md | ||
bad reference (external) at src:13:10-44: | ||
- text: "labs" | ||
- link: http://127.0.0.1:20000/labs | ||
- anchor: - | ||
|
||
⛂ ConnectionFailure Network.Socket.connect: <socket: N>: failed (Connection refused (WSAECONNREFUSED)) | ||
|
||
|
||
|
||
Invalid references dumped, 4 in total. |