From b2acabda75b4548701c89715e04d8912a07fd93b Mon Sep 17 00:00:00 2001 From: thomasjm Date: Fri, 2 Feb 2024 22:16:00 -0800 Subject: [PATCH] Try adding CI --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec323c4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: time-ghc-modules + +on: + pull_request: + push: + +jobs: + cabal: + name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest] + ghc: + - "8.10.7" + - "9.0.2" + - "9.2.8" + - "9.4.7" + - "9.6.3" + - "9.8.1" + + steps: + - uses: actions/checkout@v2 + + - uses: haskell/actions/setup@v2 + id: setup-haskell-cabal + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: "latest" + + - uses: actions/cache@v3 + name: Cache ~/.cabal/store + with: + path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + + - name: Clone hledger + run: | + git clone git@github.com:simonmichael/hledger.git + cd hledger + -- TODO: just shallow clone this somehow. Use Nix? + git reset --hard d702788a6432fa9ae49da082987463f7b907572c + + - name: Build + run: | + cd hledger + cabal clean + cabal build --ghc-options "-ddump-to-file -ddump-timings" + + - name: Clean run + run: | + cd hledger + ../time-ghc-modules