From a8cec7d83734599214c1ebcf4143b664bf0752fa Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 9 Oct 2026 15:26:17 -0400 Subject: [PATCH 1/5] Use GitHub Actions instead of Travis --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 3 --- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7910ae2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + pull_request: + +jobs: + test: + # phantomjs is packaged in 22.04 but was dropped from 24.04 + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '11' + + - uses: DeLaGuardo/setup-clojure@13.4 + with: + lein: latest + + - name: Cache Maven repository + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: m2-${{ hashFiles('project.clj') }} + restore-keys: m2- + + - name: Install PhantomJS + run: sudo apt-get update && sudo apt-get install -y phantomjs + + - name: Run tests + run: lein cleantest + env: + QT_QPA_PLATFORM: offscreen diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 97bb13a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: clojure -script: lein cleantest -sudo: false From 8c48ab8320b02ce11f5d78e5bf49163c63372f46 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 9 Oct 2026 15:26:28 -0400 Subject: [PATCH 2/5] Update README badges VersionEye no longer exists. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2731674..75d90a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# clojurescript.csv [![Build Status](https://travis-ci.org/testdouble/clojurescript.csv.png?branch=main)](https://travis-ci.org/testdouble/clojurescript.csv) [![Dependency Status](https://www.versioneye.com/user/projects/53d67fe23648f4a793000046/badge.svg)](https://www.versioneye.com/user/projects/53d67fe23648f4a793000046) +# clojurescript.csv [![Build Status](https://github.com/testdouble/clojurescript.csv/actions/workflows/ci.yml/badge.svg)](https://github.com/testdouble/clojurescript.csv/actions/workflows/ci.yml) A ClojureScript library for reading and writing comma (and other) separated values. From 2817e0b8d020b116a1290ddbbbc731b451a4d1c3 Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 9 Oct 2026 16:17:02 -0400 Subject: [PATCH 3/5] Switch tests over to Node --- .github/workflows/ci.yml | 20 +++++++++---------- node/runner.js | 15 +++++++++++++++ phantom/runner.js | 30 ----------------------------- project.clj | 8 +++----- test-resources/html/advanced.html | 5 ----- test-resources/html/simple.html | 5 ----- test-resources/html/whitespace.html | 5 ----- test/testdouble/cljs/csv_test.cljs | 8 +++++++- 8 files changed, 34 insertions(+), 62 deletions(-) create mode 100644 node/runner.js delete mode 100644 phantom/runner.js delete mode 100644 test-resources/html/advanced.html delete mode 100644 test-resources/html/simple.html delete mode 100644 test-resources/html/whitespace.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7910ae2..8dc8d1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,31 +6,29 @@ on: jobs: test: - # phantomjs is packaged in 22.04 but was dropped from 24.04 - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: temurin java-version: '11' - - uses: DeLaGuardo/setup-clojure@13.4 + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: '24' + + - uses: DeLaGuardo/setup-clojure@6d46099eae24853c33c0482f2bb54edf4f1a4c74 # 13.7.0 with: lein: latest - name: Cache Maven repository - uses: actions/cache@v4 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ~/.m2/repository key: m2-${{ hashFiles('project.clj') }} restore-keys: m2- - - name: Install PhantomJS - run: sudo apt-get update && sudo apt-get install -y phantomjs - - name: Run tests run: lein cleantest - env: - QT_QPA_PLATFORM: offscreen diff --git a/node/runner.js b/node/runner.js new file mode 100644 index 0000000..102fda3 --- /dev/null +++ b/node/runner.js @@ -0,0 +1,15 @@ +// Runs a compiled test build in a fresh context (no Node globals such as +// `process`, which collide with Closure namespaces) and exits non-zero on failure. +var fs = require('fs'); +var vm = require('vm'); + +if (process.argv.length !== 3) { + console.log('Expected a compiled test file parameter.'); + process.exit(1); +} + +var context = vm.createContext({ console: console }); +vm.runInContext(fs.readFileSync(process.argv[2], 'utf8'), context); + +var passed = vm.runInContext('testdouble.cljs.csv_test.run()', context); +process.exit(passed ? 0 : 1); diff --git a/phantom/runner.js b/phantom/runner.js deleted file mode 100644 index dd569ef..0000000 --- a/phantom/runner.js +++ /dev/null @@ -1,30 +0,0 @@ -var page = require('webpage').create(); -var system = require('system'); - -if (system.args.length !== 2) { - console.log('Expected a target URL parameter.'); - phantom.exit(1); -} - -page.onConsoleMessage = function (message) { - console.log(message); -}; - -var url = system.args[1]; - -page.open(url, function (status) { - if (status !== "success") { - console.log('Failed to open ' + url); - setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697 - phantom.exit(1); - }, 0); - } - - page.evaluate(function() { - testdouble.cljs.csv_test.run(); - }); - - setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697 - phantom.exit(0); - }, 0); -}); diff --git a/project.clj b/project.clj index 8bc5c24..9253256 100644 --- a/project.clj +++ b/project.clj @@ -22,10 +22,8 @@ :compiler {:output-to "target/js/advanced.js" :optimizations :advanced :pretty-print false}}] - :test-commands {; PhantomJS tests - "phantom-whitespace" ["phantomjs" "phantom/runner.js" "test-resources/html/whitespace.html"] - "phantom-simple" ["phantomjs" "phantom/runner.js" "test-resources/html/simple.html"] - ;; "phantom-advanced" ["phantomjs" "phantom/runner.js" "test-resources/html/advanced.html"] - }} + :test-commands {"node-whitespace" ["node" "node/runner.js" "target/js/whitespace.js"] + "node-simple" ["node" "node/runner.js" "target/js/simple.js"] + "node-advanced" ["node" "node/runner.js" "target/js/advanced.js"]}} :aliases {"cleantest" ["do" "clean," "test"] "release" ["do" "clean," "deploy" "clojars"]}) diff --git a/test-resources/html/advanced.html b/test-resources/html/advanced.html deleted file mode 100644 index d25f85e..0000000 --- a/test-resources/html/advanced.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/test-resources/html/simple.html b/test-resources/html/simple.html deleted file mode 100644 index 75153e7..0000000 --- a/test-resources/html/simple.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/test-resources/html/whitespace.html b/test-resources/html/whitespace.html deleted file mode 100644 index e5ac2f6..0000000 --- a/test-resources/html/whitespace.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/test/testdouble/cljs/csv_test.cljs b/test/testdouble/cljs/csv_test.cljs index 9353176..fab045a 100644 --- a/test/testdouble/cljs/csv_test.cljs +++ b/test/testdouble/cljs/csv_test.cljs @@ -144,5 +144,11 @@ [""]] (csv/read-csv "\na b c\n")))))) +(def ^:private passed? (atom false)) + +(defmethod t/report [::t/default :end-run-tests] [summary] + (reset! passed? (t/successful? summary))) + (defn ^:export run [] - (run-tests)) + (run-tests) + @passed?) From 73b277f7569bda5830aa0e00e62ef50a92776ffe Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 9 Oct 2026 16:17:13 -0400 Subject: [PATCH 4/5] Add Dependabot for GH Actions --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d68d377 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: { interval: monthly } + cooldown: { default-days: 14 } + groups: { github-actions: { patterns: ["*"] } } From 4443e5bb507df4c01d7a4ef7e626d0c9ebffeacf Mon Sep 17 00:00:00 2001 From: Ross Brandes Date: Fri, 9 Oct 2026 16:23:43 -0400 Subject: [PATCH 5/5] Split CI into 3 steps --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dc8d1e..56d4bfd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,5 +30,11 @@ jobs: key: m2-${{ hashFiles('project.clj') }} restore-keys: m2- - - name: Run tests - run: lein cleantest + - name: Install dependencies + run: lein do deps, cljsbuild deps + + - name: Compile + run: lein compile + + - name: Test + run: lein test