fix: use correct html
path
#12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: [push] | |
jobs: | |
check_coverage: | |
permissions: | |
contents: write | |
runs-on: ${{ github.repository_owner == 'EpitechPromo2027' && 'self-hosted' || 'ubuntu-latest' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Cache GHCup | |
uses: actions/cache@v4 | |
id: ghcup-cache | |
with: | |
path: /home/runner/.ghcup | |
key: ${{ runner.os }}-ghcup-${{ hashFiles('**/*.cabal') }} | |
restore-keys: | | |
${{ runner.os }}-ghcup- | |
- name: Cache Cabal | |
uses: actions/cache@v4 | |
id: cabal-cache | |
with: | |
path: /home/runner/.cabal | |
key: ${{ runner.os }}-cabal-${{ hashFiles('**/*.cabal') }} | |
restore-keys: | | |
${{ runner.os }}-cabal- | |
- name: Install required packages | |
run: sudo apt update && sudo apt install -y build-essential libffi-dev libgmp-dev zlib1g-dev | |
- name: Setup Haskell | |
if: ${{ steps.cabal-cache.outputs.cache-hit != 'true' && steps.ghcup-cache.outputs.cache-hit != 'true' }} | |
uses: ./external/haskell-setup | |
with: | |
ghc-version: 9.4.8 | |
cabal-version: 3.10.3.0 | |
- name: Install dependencies | |
if: ${{ steps.cabal-cache.outputs.cache-hit != 'true' }} | |
run: | | |
cabal update | |
cabal install hspec-discover hpc-codecov --overwrite-policy=always | |
- name: Setup environment | |
if: ${{ steps.cabal-cache.outputs.cache-hit == 'true' && steps.ghcup-cache.outputs.cache-hit == 'true' }} | |
run: | | |
echo "/home/runner/.cabal/bin" >> $GITHUB_PATH | |
echo "/home/runner/.ghcup/bin" >> $GITHUB_PATH | |
# This is disabled for the moment since EPITECH CI runners are not powerful enough to build the project | |
- name: Build project | |
run: cabal build --jobs=1 | |
- name: Test project | |
run: | | |
cabal configure --enable-coverage --disable-library-coverage | |
cabal test --jobs=1 | |
- name: Generate coverage report | |
run: | | |
hpc-codecov cabal:glados-test --exclude Main,Paths_glados --out codecov.json --format codecov --verbose | |
- name: Send coverage report | |
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 --haddock-contents-location=local | |
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 }} | |