Skip to content

Commit

Permalink
add post-install script for haskell (MarkUsProject#508)
Browse files Browse the repository at this point in the history
* add post-install script for haskell

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update tests with stack_root

* fix test_ci

* remove test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* disable stack upgrade recommendation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pretendWhale and pre-commit-ci[bot] committed Jul 2, 2024
1 parent 3943839 commit deedb5c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
Expand Down
2 changes: 1 addition & 1 deletion server/autotest_server/testers/haskell/haskell_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..tester import Tester, Test, TestError
from ..specs import TestSpecs

STACK_OPTIONS = ["--resolver=lts-14.27", "--system-ghc", "--allow-different-user"]
STACK_OPTIONS = ["--resolver=lts-16.17", "--system-ghc", "--allow-different-user"]


class HaskellTest(Test):
Expand Down
8 changes: 7 additions & 1 deletion server/autotest_server/testers/haskell/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def create_environment(_settings, _env_dir, default_env_dir):
resolver = "lts-14.27"
resolver = "lts-16.17"
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)

Expand All @@ -16,6 +16,12 @@ def create_environment(_settings, _env_dir, default_env_dir):

def install():
subprocess.run(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.system"), check=True)
resolver = "lts-16.17"
cmd = ["stack", "build", "--resolver", resolver, "--system-ghc", *HASKELL_TEST_DEPS]
subprocess.run(cmd, check=True)
subprocess.run(
os.path.join(os.path.dirname(os.path.realpath(__file__)), "stack_permissions.sh"), check=True, shell=True
)


def settings():
Expand Down
5 changes: 5 additions & 0 deletions server/autotest_server/testers/haskell/stack_permissions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
echo "allow-different-user: true" >> $STACK_ROOT/config.yaml
echo "recommend-stack-upgrade: false" >> $STACK_ROOT/config.yaml
chmod a+w $STACK_ROOT/stack.sqlite3.pantry-write-lock
chmod a+w $STACK_ROOT/global-project/.stack-work/stack.sqlite3.pantry-write-lock
chmod a+w $STACK_ROOT/pantry/pantry.sqlite3.pantry-write-lock

0 comments on commit deedb5c

Please sign in to comment.