Skip to content

Commit 25c836b

Browse files
committed
Add GitLab CI and GitHub Actions to tut07
1 parent d94b3b1 commit 25c836b

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

tutorials/07_test-doc-debug.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ Your project should be:
371371

372372
Another advantage of publishing is that your project can get attention and community can help you improve it -- they create issues, forks and pull requests.
373373

374-
### Using CI (Travis CI)
374+
### Using CI
375375

376-
When you are developing a project and sharing it with a community, you want to show that it is working well and you also want to check if contributions to your code are not breaking it. For that, you can use CI tools (continuous integration) which allows you to run tests (or other scripts) automatically. There are many CI tools these days: Travis CI, Jenkins, Circle CI, Appveyor, Semaphore, GitLab CI, etc.
376+
When you are developing a project and sharing it with a community, you want to show that it is working well and you also want to check if contributions to your code are not breaking it. For that, you can use CI tools (continuous integration) which allows you to run tests (or other scripts) automatically. There are many CI tools these days: Travis CI, Jenkins, Circle CI, Appveyor, Semaphore, GitLab CI, GitHub Actions, etc.
377377

378378
All (well, almost all) CIs need some specification what they should do with your project. If you are using GitHub, then Travis CI is one of the good choices for you. Just create `.travis.yml` in your repository and register project in Travis CI.
379379

@@ -401,6 +401,31 @@ script:
401401

402402
For Haskell, you can use `.travis.yml` above or read the [documentation](https://docs.travis-ci.com/user/languages/haskell/).
403403

404+
Another example shows a similar configuration but for GitLab CI (notice caching and use of system GHC from the used base image):
405+
406+
```yaml
407+
image: haskell:9.4.8
408+
409+
variables:
410+
STACK_ROOT: "${CI_PROJECT_DIR}/.stack"
411+
412+
cache:
413+
paths:
414+
- .stack
415+
- .stack-work
416+
- target
417+
418+
stages:
419+
- test
420+
421+
test:
422+
stage: test
423+
script:
424+
- stack test --system-ghc
425+
```
426+
427+
For GitHub Actions in a more complex project (multiple Stack packages, components and Docker images), you can check [ds-wizard/engine-backend](https://github.com/ds-wizard/engine-backend/blob/develop/.github/workflows/build.yml).
428+
404429
## Performance and Debugging
405430
406431
During this tutorial, we will also take a look how to improve the performance of a Haskell program and how to debug it. We will use very simple example - [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number).

0 commit comments

Comments
 (0)