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

chore: migrate to gha #55

Merged
merged 8 commits into from
Mar 31, 2022
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
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on: push

env:
STACK_YAML: stack.yaml

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: docker-compose build --pull
- run: docker-compose run --rm tests stack --stack-yaml ${STACK_YAML} setup
- run: docker-compose run --rm tests stack --stack-yaml ${STACK_YAML} clean
- run: docker-compose run --rm tests stack --stack-yaml ${STACK_YAML} build --haddock --no-haddock-deps
- run: ./runtests-ci.sh ${STACK_YAML}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ test/bob/private-keys-v1.d/
h-gpgme-*.tar.gz
src/*.js
src/*.css
.idea
h-gpgme.iml
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[![Hackage](https://img.shields.io/hackage/v/h-gpgme.svg)](https://hackage.haskell.org/package/h-gpgme) [![Build Status](https://travis-ci.org/rethab/h-gpgme.svg?branch=master)](https://travis-ci.org/rethab/h-gpgme)
[![Hackage](https://img.shields.io/hackage/v/h-gpgme.svg)](https://hackage.haskell.org/package/h-gpgme)
[![CI](https://github.com/rethab/h-gpgme/actions/workflows/ci.yml/badge.svg)](https://github.com/rethab/h-gpgme/actions/workflows/ci.yml)
![MIT License](https://img.shields.io/github/license/rethab/h-gpgme?label=license)


h-gpgme: High Level Haskell Bindings for GnuPG Made Easy
========================================================
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# For running tests on Travis-CI
version: '2'
services:
tests:
Expand Down
1 change: 0 additions & 1 deletion h-gpgme.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Extra-Source-Files:
CHANGELOG.markdown
README.markdown
.gitignore
.travis.yml


source-repository head
Expand Down
8 changes: 4 additions & 4 deletions runtests-travis → runtests-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ else
stack_yaml="$1"
fi

# Run setup again, just in case. This will already have run in actual travis build.
# This duplicate 'setup' is for testing the tests outside of travis.
# Run setup again, just in case. This will already have run in actual build.
# This duplicate 'setup' is for testing the tests outside of CI.
docker-compose run --rm tests stack --stack-yaml "$stack_yaml" setup

# Wrapper to run tests without prompts on Travis CI
docker-compose run --rm tests stack --stack-yaml "$stack_yaml" test --test-arguments '-p !**/*no_travis'
# Wrapper to run tests without prompts on CI
docker-compose run --rm tests stack --stack-yaml "$stack_yaml" test --test-arguments='--pattern=!/no_ci/'
2 changes: 1 addition & 1 deletion runtests-noprompt → runtests-noprompt.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

# same as runtests but ignores all test which prompt user
# same as runtests.sh but ignores all test which prompt user

stack test --test-arguments "-p !**/*_prompt*"
File renamed without changes.
26 changes: 13 additions & 13 deletions test/CryptoTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,26 @@ import TestUtil

tests :: TestTree
tests = testGroup "crypto"
[ testProperty "bob_encrypt_for_alice_decrypt_prompt_no_travis"
[ testProperty "bob_encrypt_for_alice_decrypt_prompt_no_ci"
$ bob_encrypt_for_alice_decrypt False
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_prompt_no_travis"
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_prompt_no_ci"
$ bob_encrypt_sign_for_alice_decrypt_verify False

, testProperty "bob_encrypt_for_alice_decrypt_short_prompt_no_travis"
, testProperty "bob_encrypt_for_alice_decrypt_short_prompt_no_ci"
bob_encrypt_for_alice_decrypt_short
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_short_prompt_no_travis"
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_short_prompt_no_ci"
bob_encrypt_sign_for_alice_decrypt_verify_short

, testCase "decrypt_garbage" decrypt_garbage
, testCase "encrypt_wrong_key" encrypt_wrong_key
, testCase "bob_encrypt_symmetrically_prompt_no_travis" bob_encrypt_symmetrically
, testCase "bob_detach_sign_and_verify_specify_key_prompt_no_travis" bob_detach_sign_and_verify_specify_key_prompt
, testCase "bob_clear_sign_and_verify_specify_key_prompt_no_travis" bob_clear_sign_and_verify_specify_key_prompt
, testCase "bob_clear_sign_and_verify_default_key_prompt_no_travis" bob_clear_sign_and_verify_default_key_prompt
, testCase "bob_normal_sign_and_verify_specify_key_prompt_no_travis" bob_normal_sign_and_verify_specify_key_prompt
, testCase "bob_normal_sign_and_verify_default_key_prompt_no_travis" bob_normal_sign_and_verify_default_key_prompt
, testCase "encrypt_file_no_travis" encrypt_file
, testCase "encrypt_stream_no_travis" encrypt_stream
, testCase "bob_encrypt_symmetrically_prompt_no_ci" bob_encrypt_symmetrically
, testCase "bob_detach_sign_and_verify_specify_key_prompt_no_ci" bob_detach_sign_and_verify_specify_key_prompt
, testCase "bob_clear_sign_and_verify_specify_key_prompt_no_ci" bob_clear_sign_and_verify_specify_key_prompt
, testCase "bob_clear_sign_and_verify_default_key_prompt_no_ci" bob_clear_sign_and_verify_default_key_prompt
, testCase "bob_normal_sign_and_verify_specify_key_prompt_no_ci" bob_normal_sign_and_verify_specify_key_prompt
, testCase "bob_normal_sign_and_verify_default_key_prompt_no_ci" bob_normal_sign_and_verify_default_key_prompt
, testCase "encrypt_file_no_ci" encrypt_file
, testCase "encrypt_stream_no_ci" encrypt_stream
]

cbTests :: IO TestTree
Expand All @@ -57,7 +57,7 @@ cbTests = do
then return $ testGroup "passphrase-cb"
[ testProperty "bob_encrypt_for_alice_decrypt"
$ bob_encrypt_for_alice_decrypt True
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_with_passphrase_cb_prompt_no_travis"
, testProperty "bob_encrypt_sign_for_alice_decrypt_verify_with_passphrase_cb_prompt_no_ci"
$ bob_encrypt_sign_for_alice_decrypt_verify True
]
else return $ testGroup "passphrase-cb" []
Expand Down
4 changes: 2 additions & 2 deletions test/KeyGenTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ tests = [ testCase "all_gen_key_parameters" all_gen_key_parameters
, testCase "expire_date_years" expire_date_years
, testCase "expire_date_seconds" expire_date_seconds
, testCase "creation_date_seconds" creation_date_seconds
, testCase "gen_key_no_travis" gen_key
, testCase "progress_callback_no_travis" progress_callback
, testCase "gen_key_no_ci" gen_key
, testCase "progress_callback_no_ci" progress_callback
]

-- For getting values from Either
Expand Down
2 changes: 1 addition & 1 deletion test/KeyTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tests = [ testCase "get_alice_pub_from_alice" get_alice_pub_from_alice
, testCase "get_inexistent_from_alice" get_inexistent_pub_from_alice
, testCase "check_alice_pub_user_ids" check_alice_pub_user_ids
, testCase "check_alice_pub_subkeys" check_alice_pub_subkeys
, testCase "remove_alice_key_prompt" remove_alice_key
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this cheating? This kept failing on CI, but perhaps this could be made working? I'd have to dig a bit more into this..

, testCase "remove_alice_key_prompt_no_ci" remove_alice_key
]

get_alice_pub_from_alice :: Assertion
Expand Down