Coder Social home page Coder Social logo

kubek2k / haskell-ci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haskell-ci/haskell-ci

0.0 1.0 0.0 1.98 MB

Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations

License: GNU General Public License v3.0

Shell 31.38% Haskell 63.45% Awk 0.06% Makefile 0.40% Dockerfile 4.70%

haskell-ci's Introduction

haskell-ci - CI generator for multiple GHC versions

At the moment haskell-ci support GitHub Actions workflow generation. There is also legacy Travis-CI configuration generator, which is unmaintained.

haskell-ci relies on hvr-ppa or ghcup to install GHC and cabal-install.

GHC-7.0.1 โ€” GHC-9.2.1 are supported.

Quick-start instructions

  • Step 1: Clone and install this project in/from any directory

    $ git clone https://github.com/haskell-CI/haskell-ci.git
    $ cd haskell-ci
    $ cabal new-install haskell-ci:exe:haskell-ci

    or

    cabal new-install haskell-ci
  • Step 2: Change directories to your project:

    $ cd path/to/your-project
  • Step 3: Edit your project's *.cabal file to add a Tested-With line, such as this one:

    $ cat your-project.cabal
    ...
    Tested-With: GHC ==8.6.3 || ==8.4.4 || ==8.2.2
    ...

    Add as many or as few GHC versions to test as you want.

  • Step 4: Generate a workflow file for your project:

    $ # You run the following command from your project's directory, even
    $ # though it references the script from the `haskell-ci` project
    $ haskell-ci github your-project.cabal

    Note: If you have multiple local Cabal projects that you wish to build together using a cabal.project file, pass that file to haskell-ci instead:

    $ haskell-ci github cabal.project

    The haskell-ci tool looks at the Tested-With line in your *.cabal files and generates a configuration that tests each compiler version you listed in parallel.

  • Step 5: Create a branch with your new CI configuration file and push your branch:

    $ git checkout master            # Check out `master`
    $ git pull --ff-only             # Get the latest version of `master`
    $ git checkout -b new-ci         # Create a `new_travis` branch
    $ git add .
    $ git commit -m "New CI script"
    $ git push -u origin new-ci      # Push your branch upstream
  • Step 6: Fix the build

    If you're lucky, your repository will build for every compiler version you listed. If that's the case, then just merge your changes into master:

    $ git checkout master
    $ git merge new-ci  # Update `master` with your new CI script
    $ git push

    You can also merge your branch into master from Github's pull request view.

    If you're not lucky, then your new CI branch will fail for one or more versions of GHC, which is okay! Look at the build and fix any build failures you find and commit the fixes to your branch:

    $ # Fix any build failures you find and commit your changes
    $ ...
    $ git push  # Push your branch updates upstream

    Sometimes you may need to regenerate CI script, for example, when adding new compiler version to tested-with. You may simply run haskell-ci regenerate.

Real-world Examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.