Skip to content

Commit

Permalink
Merge pull request #45 from Kleidukos/create-ci-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos authored Sep 25, 2023
2 parents 50b63f0 + ca364a7 commit 1a72173
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Set update schedule for GitHub Actions

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: ["master"]

jobs:
generateMatrix:
name: "Generate matrix from cabal"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout base repo
uses: actions/checkout@v3
- name: Extract the tested GHC versions
id: set-matrix
run: |
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.5.0/get-tested-0.1.5.0-linux-amd64 -O get-tested
chmod +x get-tested
./get-tested --ubuntu --macos *.cabal >> $GITHUB_OUTPUT
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generateMatrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
steps:
- name: Checkout base repo
uses: actions/checkout@v3
- name: "Configure ghcup"
run: |
ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
- name: Set up Haskell
id: setup-haskell
uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- name: Configure
run: cabal new-configure --enable-tests
- name: Freeze
run: cabal freeze
- name: Cache
uses: actions/cache@v3.3.1
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
- name: Build
run: cabal new-build
- name: Test
run: cabal new-test all
1 change: 1 addition & 0 deletions double-conversion.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ maintainer: Bryan O'Sullivan <bos@serpentine.com>
stability: experimental
synopsis: Fast conversion between single and double precision floating point and text
build-type: Simple
tested-with: GHC ==9.0.2 || ==9.2.8 || ==9.4.7 || ==9.6.2
description:
A library that performs fast, accurate conversion between
floating point and text.
Expand Down

0 comments on commit 1a72173

Please sign in to comment.