Skip to content

Commit

Permalink
ci: get working
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Nov 8, 2024
1 parent e8b4ffa commit 28972e3
Show file tree
Hide file tree
Showing 16 changed files with 327 additions and 285 deletions.
84 changes: 59 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,23 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest]
ghc:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.7"
- "9.6.3"
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "9.8.2"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
if: runner.os != 'Windows'
with:
# release-24.05
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/74435c9234c751e6786c5f3fd34ff6b0f0c13bd1.tar.gz

- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
Expand All @@ -39,16 +46,30 @@ jobs:
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}-key2

- name: Build
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal build all
# cabal configure \
# --enable-tests \
# --enable-benchmarks \
# --test-show-details=direct \
# --extra-include-dirs=/opt/homebrew/include \
# --extra-lib-dirs=/opt/homebrew/lib
cabal build all \
--extra-include-dirs=/opt/homebrew/include \
--extra-lib-dirs=/opt/homebrew/lib
- name: Test
run: |
cabal test all
cabal test all --test-option="--headless-tests"
- name: Archive test_runs
uses: actions/upload-artifact@v4
if: always()
with:
name: code-coverage-report
path: test_runs

stack:
name: stack / ghc ${{ matrix.ghc }}
Expand All @@ -57,26 +78,33 @@ jobs:
fail-fast: false
matrix:
ghc:
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.6"
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.6"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v2
- uses: cachix/install-nix-action@v27
if: runner.os != 'Windows'
with:
# release-24.05
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/74435c9234c751e6786c5f3fd34ff6b0f0c13bd1.tar.gz

- uses: haskell-actions/setup@v2
name: Setup Haskell Stack
with:
enable-stack: true
ghc-version: ${{ matrix.ghc }}
stack-version: "latest"
enable-stack: true

- uses: actions/cache@v3
name: Cache ~/.stack
- uses: actions/cache/restore@v4
name: Cache restore ~/.stack
id: cache-restore
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
Expand All @@ -87,4 +115,10 @@ jobs:
- name: Test
run: |
stack test --system-ghc
stack test --system-ghc --ta="--headless-tests"
- uses: actions/cache/save@v4
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
6 changes: 3 additions & 3 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ library:
- -Wredundant-constraints
- -Wunused-packages
dependencies:
- aeson >= 0.6.2.0
- aeson >= 1.4.1.0 && <2.3
- attoparsec >= 0.10
- attoparsec-aeson >=2.1.0.0 && <2.3
- base == 4.*
- base64-bytestring >= 1.0
- bytestring >= 0.9
Expand Down Expand Up @@ -114,8 +115,6 @@ tests:
- filepath
- http-client
- http-types
- lens
- lens-regex-pcre
- monad-logger
- mtl
- network
Expand All @@ -133,3 +132,4 @@ tests:
- wai-app-static
- warp
- webdriver
build-tools: sandwich:sandwich-discover
3 changes: 2 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ packages:
nix:
pure: false
packages:
- pcre
- pkg-config
- zlib

Expand All @@ -18,5 +17,7 @@ extra-deps:
- sandwich
- sandwich-contexts

- vty-windows-0.2.0.3

# - /home/tom/tools/sandwich/sandwich
# - /home/tom/tools/sandwich/sandwich-contexts
7 changes: 7 additions & 0 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ packages:
commit: e295a2e93f1dc03d8c31eb78f4efb74ea6720fbb
git: https://github.com/codedownio/sandwich
subdir: sandwich-contexts
- completed:
hackage: vty-windows-0.2.0.3@sha256:0c010b1086a725046a8bb08bb1e6bfdfdb3cfe1c72d6fa77c37306ef9ec774d8,2844
pantry-tree:
sha256: 958fd0386c589130177c841df63368ff191eb296f9ed2fd050de10e266c354eb
size: 2160
original:
hackage: vty-windows-0.2.0.3
snapshots:
- completed:
sha256: 6c5aeace2ca5ecde793a9e0acfaa730ec8f384aa2f6183a2a252f5f9ec55d623
Expand Down
41 changes: 0 additions & 41 deletions test-static/resultPage.html

This file was deleted.

113 changes: 0 additions & 113 deletions test-static/simpleTest.html

This file was deleted.

28 changes: 28 additions & 0 deletions test-static/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
<h1>Button clicking</h1>
<button id="incrementButton">Increment</button>
<label id="numberLabel">0</label>

<script>
let count = 0;
const btn = document.getElementById("incrementButton");
const label = document.getElementById("numberLabel");

btn.addEventListener("click", function() {
count++;
label.textContent = count;
});
</script>

<h1>Checkboxes</h1>
<input type="checkbox" id="checkbox" name="checkbox" value="checked">
<label for="checkbox">Check me</label><br><br>
</body>
</html>
29 changes: 0 additions & 29 deletions test-static/test_page.html

This file was deleted.

Loading

0 comments on commit 28972e3

Please sign in to comment.