Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Stack #120

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .dir-locals.el

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: review
on:
- pull_request
jobs:
check:
name: Compile and test
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: haskell-actions/setup@v2
with:
ghc-version: '9.4.5' # Exact version of ghc to use

- name: update cabal index
run: |
cabal v2-update -v

- name: checkout
uses: actions/checkout@v3

- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-

- name: install dependencies
run: cabal v2-build -v --enable-tests all --dependencies-only -j2 all

- name: tests
run: cabal v2-test --enable-tests all --test-show-details=direct

- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ github.sha }}
path: ~/.cabal/store
28 changes: 0 additions & 28 deletions .github/workflows/haskell.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cabal.sandbox.config
.*.swp
*.log
*.dump-hi
dist-newstyle/
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM haskell:8.10
FROM haskell:9.4.5
RUN mkdir -p /app/user
WORKDIR /app/user
COPY stack.yaml *.cabal ./
COPY *.cabal ./

RUN export PATH=$(stack path --local-bin):$PATH
RUN stack build --dependencies-only
RUN cabal v2-update
RUN cabal v2-build --dependencies-only

COPY . /app/user
RUN stack install
RUN cabal v2-install

ENV LANG C.UTF-8
CMD /root/.local/bin/mat-chalmers
Expand Down
3 changes: 1 addition & 2 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Data.IORef ( IORef
)
import Data.Time.Format ( defaultTimeLocale
, formatTime
, iso8601DateFormat
)
import Lens.Micro.Platform ( set
, view
Expand Down Expand Up @@ -97,7 +96,7 @@ main = (reifyConfig . getOpt Permute opts <$> getArgs) >>= \case
(runReaderT (refresh viewRef upd) (ClientContext cfg mgr))
( logCallback
. renderWithTimestamp
(formatTime defaultTimeLocale (iso8601DateFormat (Just "%H:%M:%S")))
(formatTime defaultTimeLocale "T%H:%M:%S")
id
)

Expand Down
51 changes: 27 additions & 24 deletions mat-chalmers.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ maintainer: [email protected]
category: Web
build-type: Simple
cabal-version: >=1.10
Tested-With: GHC ==9.4.5
data-files:
static/style.css
static/icon.png
Expand All @@ -28,56 +29,58 @@ library
, Config
, Util

build-depends: aeson
, attoparsec
, base >=4.7
, css-text
, exceptions == 0.10.4
-- Prefer to put the dependencies with versions here, and the ones without
-- versions in the `build-depends` blocks below.
build-depends: aeson >= 2.1.2.1 && < 3.0
, attoparsec >= 0.14.4 && < 0.15
, base >=4.17.1.0 && < 5.0
, bytestring >=0.11 && < 0.12
, css-text >= 0.1.3.0 && < 0.2
, exceptions >= 0.10.5 && < 0.11.0
, heredoc == 0.2.0.0
, http-client
, http-client-tls == 0.3.5.3
, logging-effect == 1.3.12
, microlens-platform
, lucid >= 2
, http-client >= 0.7.14 && < 0.8
, http-client-tls >= 0.3.6.1 && <= 0.4
, logging-effect >= 1.4.0 && <= 2.0
, microlens-platform >= 0.4.3.3 && < 0.5
, lucid >= 2 && < 3
, mtl == 2.2.2
, old-locale == 1.0.0.7
, prettyprinter == 1.7.1
, safe == 0.3.19
, tagsoup == 0.14.8
, text == 1.2.4.1
, bytestring == 0.10.12.0
, file-embed
, thyme
, text >= 2.0 && <= 3.0
, file-embed >= 0.0.15.0 && < 1.0
, thyme >= 0.4 && <= 0.5
, word8 == 0.1.3

executable mat-chalmers
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Werror -Wunused-binds -Wunused-imports -Wcompat
hs-source-dirs: app
build-depends: mat-chalmers
, base >= 4.7
, base
, bytestring
, file-embed
, http-client-tls == 0.3.5.3
, http-client-tls
, microlens-platform
, logging-effect
, mtl
, scotty
, time == 1.9.3
, wai-extra
, scotty >= 0.12.1 && < 0.13
, time >= 1.12 && < 1.13
, wai-extra >= 3.1.13.0 && < 4.0
, wai-middleware-static-embedded == 0.1.0.0
, async >= 2.1.1
, async >= 2.2.4 && <= 3.0
default-language: Haskell2010

Test-Suite test-mat
type: exitcode-stdio-1.0
main-is: Main.hs
hs-source-dirs: test
default-language: Haskell2010
build-depends: base >= 4.7
build-depends: base
, bytestring
, mat-chalmers
, hspec == 2.7.10
, HUnit == 1.6.2.0
, hspec >= 2.10.10 && < 3.0
, HUnit >= 1.6.2.0 && < 2.0
, text
, thyme == 0.3.5.5
, thyme
4 changes: 2 additions & 2 deletions src/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ where
import Data.FileEmbed
import qualified Data.Text.Lazy as T
import qualified Data.Text.Lazy.Builder as T
import Data.Thyme
import Data.Thyme ( defaultTimeLocale
, formatTime )
import Lens.Micro.Platform ( (&)
, (%~)
, both
)
import Lucid
import System.Locale ( defaultTimeLocale )
import qualified Text.CSS.Parse as CSS
import qualified Text.CSS.Render as CSS

Expand Down
8 changes: 0 additions & 8 deletions stack.yaml

This file was deleted.

Loading