Skip to content

Commit

Permalink
Merge pull request #31 from RNCryptor/adinapoli/ghc-8.10.4
Browse files Browse the repository at this point in the history
Support 8.10.4 and release 0.3.0.2
  • Loading branch information
adinapoli authored Apr 7, 2021
2 parents 2c4fdb4 + d3630cc commit a81769a
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 203 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Haskell CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.6.5', '8.8.4','8.10.2', '8.10.3']
cabal: ['3.2.0.0']

os: [ubuntu-latest]
exclude:
# GHC 8.8+ only works with cabal v3+
- ghc: 8.8.4
cabal: 2.4.1.0

name: cabal / ghc ${{ matrix.ghc }}
steps:
- uses: actions/checkout@v2
- name: Setup Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- uses: actions/[email protected]
name: Cache ~/.cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}

- name: Build
run: |
cabal v2-build all
- name: Test
run: |
cabal v2-test all
stack:
name: stack / ghc ${{ matrix.ghc }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
stack: ["2.3.1"]
ghc: ["8.10.4"]

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'

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

- uses: actions/[email protected]
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --stack-yaml stack-${{ matrix.ghc }}.yaml
- name: Test
run: |
stack test --system-ghc --stack-yaml stack-${{ matrix.ghc }}.yaml
195 changes: 0 additions & 195 deletions .travis.yml

This file was deleted.

16 changes: 13 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,26 @@
build: off

before_test:
- curl -sS -ostack.zip -L --insecure http://www.stackage.org/stack/windows-i386
# http://help.appveyor.com/discussions/problems/6312-curl-command-not-found
- set PATH=C:\Program Files\Git\mingw64\bin;%PATH%

- curl -sS -ostack.zip -L --insecure https://get.haskellstack.org/stable/windows-x86_64.zip
- 7z x stack.zip stack.exe

clone_folder: "c:\\stack"
environment:
global:
STACK_ROOT: "c:\\sr"

# Override the temp directory to avoid sed escaping issues
# See https://github.com/haskell/cabal/issues/5386
TMP: "c:\\tmp"

matrix:
- ARGS: "--stack-yaml=stack-8.10.4.yaml"

test_script:
- stack setup > nul
- stack %ARGS% setup > nul
# The ugly echo "" hack is to avoid complaints about 0 being an invalid file
# descriptor
- echo "" | stack --no-terminal test --flag rncryptor:-fastpbkdf2
- echo "" | stack %ARGS% --no-terminal test --flag rncryptor:-fastpbkdf2
6 changes: 6 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
packages: .

allow-newer:
bytestring-arbitrary:base

tests: true
4 changes: 2 additions & 2 deletions rncryptor.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: rncryptor
version: 0.3.0.1
version: 0.3.0.2
synopsis: Haskell implementation of the RNCryptor file format
description: Pure Haskell implementation of the RNCrytor spec.
license: MIT
Expand Down Expand Up @@ -67,7 +67,7 @@ test-suite rncryptor-tests
, tasty-quickcheck
, tasty-hunit
, io-streams
, base16-bytestring
, base16-bytestring >= 1.0.0.0
, cryptonite
, text
, bytestring-arbitrary >= 0.1.0
Expand Down
4 changes: 2 additions & 2 deletions src/Crypto/RNCryptor/V3/Decrypt.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ parseSingleWord8 err = do
put vs
case B.unpack v of
[x] -> return x
_ -> fail err
_ -> error err

--------------------------------------------------------------------------------
parseBSOfSize :: Int -> String -> State ByteString ByteString
Expand All @@ -62,7 +62,7 @@ parseBSOfSize sz err = do
let (v,vs) = B.splitAt sz bs
put vs
case B.unpack v of
[] -> fail err
[] -> error err
_ -> return v

--------------------------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions stack-8.10.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resolver: lts-17.5
install-ghc: true
allow-newer: true
flags: {}
packages:
- '.'
system-ghc: false
extra-deps:
- bytestring-arbitrary-0.1.3
- base16-bytestring-1.0.0.0
- fastpbkdf2-0.1.0.0
2 changes: 1 addition & 1 deletion test/PasswordBasedVectors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data TestVector = TestVector {

--------------------------------------------------------------------------------
unhex :: ByteString -> ByteString
unhex = fst . decode
unhex = decodeLenient

--------------------------------------------------------------------------------
withTestVector :: TestVector -> Assertion
Expand Down

0 comments on commit a81769a

Please sign in to comment.