🛠️:octocat: Generic testing CI with auto-grading and GitHub integration
Go to file
2020-02-24 20:09:37 +03:00
app Added default config printing 2020-02-24 16:26:11 +03:00
migrations Initial working commit 2020-02-24 16:26:11 +03:00
src better error reporting 2020-02-24 20:09:37 +03:00
.gitignore removed cabal 2020-02-24 16:26:11 +03:00
hie.yaml Initial working commit 2020-02-24 16:26:11 +03:00
LICENSE Initial working commit 2020-02-24 16:26:11 +03:00
package.yaml Made things actually work 2020-02-24 16:26:11 +03:00
README.md added readme 2020-02-24 16:26:11 +03:00
Setup.hs Initial working commit 2020-02-24 16:26:11 +03:00
stack.yaml Bumped dependancies 2020-02-24 16:26:11 +03:00
tasks.yaml Made things actually work 2020-02-24 16:26:11 +03:00

sc-build

Need both manual weebohook and app.

Installation id needs to be configured manually.

Usage

You want to have some predefined docker container with maximum dependencies cached.

Exmaple:

FROM fpco/stack-build:lts-14.27

RUN stack update
RUN stack build tasty tasty-hspec aeson containers bytestring

WORKDIR /

You need to build that container and git it a name:

docker build -t fast-lts-14.27 - < FastDockerFile

After that you can use it in your tasks.yaml:

test-task:
  prebuild: |
    cp -f ../../test-task/package.yaml .
    cp -f ../../test-task/stack.yaml .
    cp -f -R ../../test-task/test .    
  dockerfile: |
    FROM fast-lts-14.27
    COPY . src
    WORKDIR /src
    ENTRYPOINT stack test --fast    
  timeoutMinutes: 10

The docker container is expected to write json to stdout, conating test results:

{
  "test1": true,
  "test2": false
}

For macos docker API:

socat TCP-LISTEN:1234,range=127.0.0.1/32,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock

or this (didn't work for me):

docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2357:1234 bobrik/socat TCP-LISTEN:1234,fork UNIX-CONNECT:/var/run/docker.sock