From fddc63214f7a2b053e6cf4f555b13937d891a49a Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Wed, 1 Nov 2023 01:29:00 +0000 Subject: [PATCH] Add Stan to CI --- .github/workflows/stan.yml | 39 +++++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 4 ++-- .stan.toml | 4 ++-- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/stan.yml diff --git a/.github/workflows/stan.yml b/.github/workflows/stan.yml new file mode 100644 index 00000000..33ce8a41 --- /dev/null +++ b/.github/workflows/stan.yml @@ -0,0 +1,39 @@ +name: Apply stan + +on: + pull_request: + workflow_dispatch: + +jobs: + build: + name: Apply stan + runs-on: ubuntu-latest + + steps: + - name: Clone project + uses: actions/checkout@v4 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ~/.stack + key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }} + + - name: Install stan + run: | + git clone https://github.com/kowainik/stan.git + cd stan + stack --local-bin-path ../.bin install + cd .. + + - name: Generate .hie for analysis + run: stack build pantry:lib + + - name: Run stan + run: .bin/stan report --cabal-file-path=pantry.cabal + + - name: Upload HTML report + uses: actions/upload-artifact@v3 + with: + name: Stan_report + path: stan.html diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index abe21139..d08a0f74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: resolver: stack-ghc-9.6.3.yaml steps: - name: Clone project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies on Unix-like OS if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') uses: actions/cache@v3 @@ -63,7 +63,7 @@ jobs: - stack-ghc-9.4.7.yaml steps: - name: Clone project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache dependencies on Unix-like OS if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') uses: actions/cache@v3 diff --git a/.stan.toml b/.stan.toml index 7d736608..7fe44a83 100644 --- a/.stan.toml +++ b/.stan.toml @@ -24,7 +24,7 @@ # Anti-pattern: Data.ByteString.Char8.pack [[ignore]] - id = "OBS-STAN-0203-RDkR59-110:17" + id = "OBS-STAN-0203-RDkR59-114:17" # ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters # ✦ Category: #AntiPattern # ✦ File: src/Hackage\Security\Client\Repository\HttpLib\HttpClient.hs @@ -43,7 +43,7 @@ # Anti-pattern: Slow 'length' for Text [[ignore]] - id = "OBS-STAN-0208-gkCCTP-1100:14" + id = "OBS-STAN-0208-gkCCTP-1150:14" # ✦ Description: Usage of 'length' for 'Text' that runs in linear time # ✦ Category: #AntiPattern # ✦ File: src/Pantry.hs