diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3f5e1dca5..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,113 +0,0 @@ -version: 2.1 - -orbs: - coveralls: coveralls/coveralls@2.2.5 - -workflows: - tests: - jobs: - - build: - context: coveralls-context - -jobs: - build: - docker: - - image: fpco/stack-build:lts-23 - steps: - - checkout - - run: git remote add upstream https://github.com/Courseography/courseography.git - - run: git fetch upstream - - - restore_cache: - name: Restore Cached Dependencies (Haskell) - keys: - - v1.4-courseography-haskell-{{ checksum "courseography.cabal" }}-{{ checksum "stack.yaml.lock" }} - - v1.4-courseography-haskell-{{ checksum "courseography.cabal" }} - - v1.4-courseography-haskell-{{ checksum "stack.yaml.lock" }} - - v1.4-courseography-haskell- - - restore_cache: - name: Restore Cached Dependencies (Imagemagick) - keys: - - v1.4-courseography-imagemagick-squashfs-root - - - run: - name: Install Package Dependencies - command: | - sudo apt-get update - sudo apt-get install -y graphviz - sudo apt-get install -y texlive-latex-base - if [ ! -d squashfs-root ]; then - sudo wget https://download.imagemagick.org/archive/binaries/magick - sudo chmod u+x ./magick - sudo ./magick --appimage-extract - fi - sudo dpkg --remove --force-remove-reinstreq nodejs - stack update - - curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - &&\ - sudo dpkg --remove --force-remove-reinstreq libnode72:amd64 - sudo apt-get install -y nodejs - - corepack enable - corepack prepare pnpm@11.21.0 --activate - - - run: - name: Set PATH - command: | - echo 'export PATH=$(pwd)/squashfs-root/usr/bin:"$PATH"' >> "$BASH_ENV" - source "$BASH_ENV" - - - run: - name: Resolve/Update Dependencies - command: | - stack --no-terminal setup - rm -fr $(stack path --dist-dir) $(stack path --local-install-root) - stack --no-terminal build --fast -j4 --ghc-options -Werror - stack build hlint - stack build fourmolu - stack build hpc-lcov - pnpm ci - - - save_cache: - name: Cache Dependencies (Haskell) - key: v1.4-courseography-haskell-{{ checksum "courseography.cabal" }}-{{ checksum "stack.yaml.lock" }} - paths: - - "/root/.stack" - - ".stack-work" - - - save_cache: - name: Cache Dependencies (Imagemagick) - key: v1.4-courseography-imagemagick-squashfs-root - paths: - - "squashfs-root" - - - run: - name: Run Frontend Tests and Generate Coverage - command: | - pnpm test --coverage --maxWorkers=4 - mv coverage/lcov.info coverage/frontend.info - - - run: - name: Run Backend Tests and Generate Coverage - command: | - stack --no-terminal test --coverage - $(stack exec which hpc-lcov) -o coverage/backend.info - - - coveralls/upload: - coverage_files: coverage/frontend.info coverage/backend.info - - - run: - name: Run lint-staged checks - command: | - pnpm exec lint-staged --diff="upstream/master...$(git branch --show-current)" - - - run: - name: Generate documentation - command: | - stack exec haddock -- -o doc -h --optghc=-iapp --optghc=-XOverloadedStrings --optghc=-XPartialTypeSignatures --optghc=-XScopedTypeVariables --optghc=-XLambdaCase --ignore-all-exports app/Main.hs - - - store_artifacts: - path: doc - destination: docs - # The resource_class feature allows configuring CPU and RAM resources for each job. Different resource classes are available for different executors. https://circleci.com/docs/reference/configuration-reference/#resourceclass - resource_class: large diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5cf05bbae..27b8af7ec 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -42,7 +42,8 @@ Before opening your pull request: After opening your pull request: -- [ ] I have verified that the CircleCI checks have passed. +- [ ] I have verified that the CI checks have passed. +- [ ] I have reviewed the test coverage changes reported by Coveralls. - [ ] I have [requested a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from a project maintainer. ## Questions and Comments diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..d6b8377c8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,104 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + container: + image: fpco/stack-build:lts-23 + env: + HOME: /root + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Configure git for container user mismatch + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + git remote add upstream https://github.com/Courseography/courseography.git + git fetch upstream + + - name: Restore Haskell dependency cache + uses: actions/cache@v6 + with: + path: | + /root/.stack + .stack-work + key: v1-courseography-haskell-${{ hashFiles('courseography.cabal') }}-${{ hashFiles('stack.yaml.lock') }} + restore-keys: | + v1-courseography-haskell-${{ hashFiles('courseography.cabal') }}- + v1-courseography-haskell- + + - name: Restore ImageMagick cache + uses: actions/cache@v6 + with: + path: squashfs-root + key: v1-courseography-imagemagick-squashfs-root + + - name: Install package dependencies + run: | + apt-get update + apt-get install -y graphviz + apt-get install -y texlive-latex-base + if [ ! -d squashfs-root ]; then + wget --tries=5 --retry-connrefused --waitretry=10 -O magick https://github.com/ImageMagick/ImageMagick/releases/download/7.1.2-31/ImageMagick-7.1.2-31-gcc-x86_64.AppImage + chmod u+x ./magick + ./magick --appimage-extract + fi + stack --allow-different-user update + + - uses: pnpm/setup@v2.1.0 + with: + cache: true + runtime: node@24 + require-lockfile: true + + - name: Set PATH + run: echo "$(pwd)/squashfs-root/usr/bin" >> "$GITHUB_PATH" + + - name: Resolve/Update Dependencies + run: | + stack --allow-different-user --no-terminal setup + rm -fr $(stack --allow-different-user path --dist-dir) $(stack --allow-different-user path --local-install-root) + stack --allow-different-user --no-terminal build --fast -j4 --ghc-options -Werror + stack --allow-different-user build hlint + stack --allow-different-user build fourmolu + stack --allow-different-user build hpc-lcov + + - name: Run Frontend Tests and Generate Coverage + run: | + pnpm test --coverage --maxWorkers=4 + mv coverage/lcov.info coverage/frontend.info + + - name: Run Backend Tests and Generate Coverage + run: | + stack --allow-different-user --no-terminal test --coverage + $(stack --allow-different-user exec which hpc-lcov) -o coverage/backend.info + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + files: coverage/frontend.info coverage/backend.info + + - name: Run lint-staged checks + run: pnpm exec lint-staged --diff="upstream/master...HEAD" + + - name: Generate documentation + run: | + stack --allow-different-user exec haddock -- -o doc -h --optghc=-iapp --optghc=-XOverloadedStrings --optghc=-XPartialTypeSignatures --optghc=-XScopedTypeVariables --optghc=-XLambdaCase --ignore-all-exports app/Main.hs + + - name: Upload documentation artifact + uses: actions/upload-artifact@v7 + with: + name: docs + path: doc diff --git a/CHANGELOG.md b/CHANGELOG.md index ee56ebc85..75448ca0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Added peer dependency overrides for `eslint-plugin-react` (for `eslint` v10) and `@babel/plugin-syntax-*` (for `@babel/core` v8.0.1 - Set `NODE_ENV=production` for webpack `build` command - Fixed dynamic graph centering bug by updating `parseTransform` in `app/Svg/Parser.hs` to parse multiple transform functions and removing `getShapesMinXY` in `js/components/graph/Graph.js` +- Switched CI provider from CircleCI to GitHub Actions ## [0.8.1] - 2026-08-10