From 82bd1bcc5aee923ec868d78baa4c8c165ee9bd1e Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Thu, 3 Sep 2026 17:13:14 -0400 Subject: [PATCH 01/13] Switched CI provider from CircleCI to GitHub Actions --- .circleci/config.yml | 113 ------------------------------- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci.yml | 104 ++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 4 files changed, 106 insertions(+), 114 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml 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..4cf94e871 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -42,7 +42,7 @@ 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 [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..abc654f8c --- /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 + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Add upstream remote + run: | + git remote add upstream https://github.com/Courseography/courseography.git + git fetch upstream + + - name: Restore Haskell dependency cache + uses: actions/cache@v4 + 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@v4 + 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 https://download.imagemagick.org/archive/binaries/magick + chmod u+x ./magick + ./magick --appimage-extract + fi + dpkg --remove --force-remove-reinstreq nodejs + stack update + + curl -fsSL https://deb.nodesource.com/setup_24.x | bash - + dpkg --remove --force-remove-reinstreq libnode72:amd64 + apt-get install -y nodejs + + corepack enable + corepack prepare pnpm@11.21.0 --activate + + - name: Set PATH + run: echo "$(pwd)/squashfs-root/usr/bin" >> "$GITHUB_PATH" + + - name: Resolve/Update Dependencies + run: | + 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 install --frozen-lockfile + + - 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 --no-terminal test --coverage + $(stack 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 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@v4 + 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 From 6a2ed22aca6d3c4c42bf7bc25dec31834d7b9103 Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 21:21:51 -0400 Subject: [PATCH 02/13] Updated CI actions versions --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index abc654f8c..deb339864 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: container: image: fpco/stack-build:lts-23 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 with: fetch-depth: 0 @@ -26,7 +26,7 @@ jobs: git fetch upstream - name: Restore Haskell dependency cache - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: | /root/.stack @@ -37,7 +37,7 @@ jobs: v1-courseography-haskell- - name: Restore ImageMagick cache - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: squashfs-root key: v1-courseography-imagemagick-squashfs-root @@ -98,7 +98,7 @@ jobs: stack 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@v4 + uses: actions/upload-artifact@v7 with: name: docs path: doc From 02688b430ce9e08394465bb05985e9c470fe481d Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 21:25:51 -0400 Subject: [PATCH 03/13] Removed unnecessary remote addition --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index deb339864..218611049 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,6 @@ jobs: with: fetch-depth: 0 - - name: Add upstream remote - run: | - git remote add upstream https://github.com/Courseography/courseography.git - git fetch upstream - - name: Restore Haskell dependency cache uses: actions/cache@v6 with: From ba14619f0d447c1c19f080b62d5e52526f76aec5 Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 21:33:56 -0400 Subject: [PATCH 04/13] Fixed HOME variable for stack commands --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 218611049..d9a0fd7fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,8 @@ jobs: runs-on: ubuntu-latest container: image: fpco/stack-build:lts-23 + env: + HOME: /root steps: - uses: actions/checkout@v7 with: From 427ff838a57168fef2ba4739871e6780390d99f2 Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 21:38:46 -0400 Subject: [PATCH 05/13] Added STACK_ALLOW_DIFFERENT_USER: 'true' --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9a0fd7fb..c4a9c0b33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: image: fpco/stack-build:lts-23 env: HOME: /root + STACK_ALLOW_DIFFERENT_USER: "true" steps: - uses: actions/checkout@v7 with: From b07a66fd52b53cbba58c8c39d25a02ae71ef8cf9 Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 21:59:53 -0400 Subject: [PATCH 06/13] Added retries to imagemagick download --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4a9c0b33..732b256ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: apt-get install -y graphviz apt-get install -y texlive-latex-base if [ ! -d squashfs-root ]; then - wget https://download.imagemagick.org/archive/binaries/magick + wget --tries=5 --retry-connrefused --waitretry=10 https://download.imagemagick.org/archive/binaries/magick chmod u+x ./magick ./magick --appimage-extract fi From 1ce98e4774f52c6e043f3c75c2adb83abda9c049 Mon Sep 17 00:00:00 2001 From: David Liu Date: Thu, 3 Sep 2026 22:10:42 -0400 Subject: [PATCH 07/13] Added --allow-different-user command --- .github/workflows/ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 732b256ef..2111684a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ jobs: image: fpco/stack-build:lts-23 env: HOME: /root - STACK_ALLOW_DIFFERENT_USER: "true" steps: - uses: actions/checkout@v7 with: @@ -51,7 +50,7 @@ jobs: ./magick --appimage-extract fi dpkg --remove --force-remove-reinstreq nodejs - stack update + stack --allow-different-user update curl -fsSL https://deb.nodesource.com/setup_24.x | bash - dpkg --remove --force-remove-reinstreq libnode72:amd64 @@ -65,12 +64,12 @@ jobs: - name: Resolve/Update Dependencies run: | - 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 + 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 pnpm install --frozen-lockfile - name: Run Frontend Tests and Generate Coverage @@ -80,8 +79,8 @@ jobs: - name: Run Backend Tests and Generate Coverage run: | - stack --no-terminal test --coverage - $(stack exec which hpc-lcov) -o coverage/backend.info + 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 @@ -93,7 +92,7 @@ jobs: - name: Generate documentation run: | - stack exec haddock -- -o doc -h --optghc=-iapp --optghc=-XOverloadedStrings --optghc=-XPartialTypeSignatures --optghc=-XScopedTypeVariables --optghc=-XLambdaCase --ignore-all-exports app/Main.hs + 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 From 2a0fe08d601d2dcc1f5f60197a894058585aa590 Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 07:09:09 -0400 Subject: [PATCH 08/13] Fixed git dubious ownership issue and added upstream remote for lint-staged check --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2111684a3..905649596 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,12 @@ jobs: 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: From 44514bf28bbe090235880a4a638c09e12f44bb7b Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 16:54:59 -0400 Subject: [PATCH 09/13] Updated magick binary download --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 905649596..a51daabc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: apt-get install -y graphviz apt-get install -y texlive-latex-base if [ ! -d squashfs-root ]; then - wget --tries=5 --retry-connrefused --waitretry=10 https://download.imagemagick.org/archive/binaries/magick + 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 From f11f2cc7c5863fa6abcafda036e01a9eb32c1c16 Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 17:36:59 -0400 Subject: [PATCH 10/13] Updated pull request template to mention coveralls --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4cf94e871..27b8af7ec 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -43,6 +43,7 @@ Before opening your pull request: After opening your pull request: - [ ] 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 From 6003ec6678c0fb11157a32f9a614e91b4bfc5b5a Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 17:52:28 -0400 Subject: [PATCH 11/13] Updated GitHub Actions to use pnpm/setup action --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a51daabc4..94db1c53c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,15 +55,12 @@ jobs: chmod u+x ./magick ./magick --appimage-extract fi - dpkg --remove --force-remove-reinstreq nodejs stack --allow-different-user update - curl -fsSL https://deb.nodesource.com/setup_24.x | bash - - dpkg --remove --force-remove-reinstreq libnode72:amd64 - apt-get install -y nodejs - - corepack enable - corepack prepare pnpm@11.21.0 --activate + - uses: pnpm/setup@v2 + with: + runtime: node@24 + require-lockfile: true - name: Set PATH run: echo "$(pwd)/squashfs-root/usr/bin" >> "$GITHUB_PATH" @@ -76,7 +73,6 @@ jobs: stack --allow-different-user build hlint stack --allow-different-user build fourmolu stack --allow-different-user build hpc-lcov - pnpm install --frozen-lockfile - name: Run Frontend Tests and Generate Coverage run: | From 31acfe9012bd92414f0e11d6fc279aab332c5e51 Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 17:55:42 -0400 Subject: [PATCH 12/13] Added cache: true to use of pnpm/setup --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94db1c53c..d18555d75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,6 +59,7 @@ jobs: - uses: pnpm/setup@v2 with: + cache: true runtime: node@24 require-lockfile: true From 913f383c32a78d8a361d2e4125916753d4201cd7 Mon Sep 17 00:00:00 2001 From: David Liu Date: Fri, 4 Sep 2026 18:13:15 -0400 Subject: [PATCH 13/13] Ensure pnpm/setup uses v2.1.0 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d18555d75..d6b8377c8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: fi stack --allow-different-user update - - uses: pnpm/setup@v2 + - uses: pnpm/setup@v2.1.0 with: cache: true runtime: node@24