|
| 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/** |
0 commit comments