Skip to content

add: Shared.UtilsSpec #75

add: Shared.UtilsSpec

add: Shared.UtilsSpec #75

Workflow file for this run

name: Coverage Report
on: [push]
jobs:
check_coverage:
permissions:
contents: write
if: github.repository_owner != 'EpitechPromo2027'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install required packages
run: sudo apt update && sudo apt install -y build-essential libffi-dev libgmp-dev zlib1g-dev
- name: Setup Haskell
uses: ./external/haskell-setup
with:
ghc-version: 9.4.8
cabal-version: 3.12.1.0
- name: Setup Deno
if: github.ref == 'refs/heads/main'
uses: ./external/setup-deno
with:
deno-version: v2.x
- name: Install Chrome dependencies
if: github.ref == 'refs/heads/main'
run: |
sudo apt install -y --no-install-recommends \
libnss3 \
libdbus-1-3 \
libatk1.0-0 \
libasound2t64 \
libxrandr2 \
libxkbcommon-dev \
libxfixes3 \
libxcomposite1 \
libxdamage1 \
libgbm-dev \
libatk-bridge2.0-0 \
binutils \
libglib2.0-0 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libnss3-dev \
libxss-dev \
xvfb \
fonts-liberation \
libu2f-udev \
xdg-utils
- name: Setup Chrome
uses: ./external/setup-chrome
if: github.ref == 'refs/heads/main'
id: setup-chrome
with:
chrome-version: stable
install-dependencies: false
- name: Install dependencies
run: |
cabal update
cabal install hspec-discover hpc-codecov --overwrite-policy=always
- name: Build project
run: cabal build
- name: Test project
run: |
cabal configure --enable-coverage
cabal test
- name: Generate coverage report
run: |
hpc-codecov cabal:glados-test --exclude Main,Paths_glados --out codecov.json --format codecov --verbose
- name: Publish coverage report to Discord
if: github.ref == 'refs/heads/main'
run: |
deno run -A scripts/publish-coverage.ts ${{ secrets.WEBHOOK_URL }} ${{ steps.setup-chrome.outputs.chrome-path }}
- name: Send coverage report to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
- name: Generate Haddock documentation
if: github.ref == 'refs/heads/main'
run: |
cabal haddock --haddock-html --haddock-hyperlink-source --haddock-quickjump
echo "DOCS_DIR=$(find dist-newstyle/build -type d -path '*/doc/html/glados' | head -n 1)" >> $GITHUB_ENV
- name: Deploy Haddock to GitHub Pages
uses: ./external/actions-gh-pages
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.DOCS_DIR }}