Skip to content

Commit

Permalink
Add build step to cache portal client artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
djblue committed Nov 30, 2024
1 parent 3cb5bea commit 8083a57
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 8 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/clojure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,49 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/setup
- run: bb check
test-clj:
build:
needs: [ setup ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- run: bb -m tasks.build/build
- uses: actions/upload-artifact@v4
with:
name: portal-client
path: resources/portal
test-clj:
needs: [ setup, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: portal-client
path: resources/portal
- run: bb -m tasks.test/clj
test-cljs:
needs: [ setup ]
needs: [ setup, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: portal-client
path: resources/portal
- run: bb -m tasks.test/cljs
test-cljr:
needs: [ setup ]
needs: [ setup, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/setup
- uses: actions/download-artifact@v4
with:
name: portal-client
path: resources/portal
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
Expand Down
4 changes: 2 additions & 2 deletions dev/tasks/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
(npm :ci)))

(defn main-js []
(install)
(when (seq
(fs/modified-since
"resources/portal/main.js"
Expand All @@ -22,18 +21,19 @@
"package-lock.json"
"shadow-cljs.edn"]
(fs/glob "src/portal/ui" "**.cljs"))))
(install)
(shadow :release :client))
(fs/copy "resources/icon.svg"
"resources/portal/icon.svg"
{:replace-existing true}))

(defn ws-js []
(install)
(let [out "resources/portal/ws.js"]
(when (seq
(fs/modified-since
out
["package.json" "package-lock.json"]))
(install)
(npx :browserify
"--node"
"--exclude" :bufferutil
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
(t/node out)))

(defn cljs-runtime [version]
(build)
(cljs* {'org.clojure/clojurescript {:mvn/version version}} :portal.test-runtime-runner))

(defn- get-cljs-deps []
Expand All @@ -47,6 +46,7 @@
(setup* "1.10.844"))

(defn cljs []
(build)
(cljs-runtime "1.10.773")
(cljs-runtime "1.10.844")
(cljs-nbb)
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/portal/runtime/npm_test.cljc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
(ns portal.runtime.npm-test
(:require [clojure.test :refer [deftest are]]
[portal.runtime.shell :refer [sh]]
[portal.runtime.npm :refer [node-resolve]]))

(deftest valid-modules
(sh "npm" "install" "react@^17.0.2")
(are [module]
(some? (node-resolve module))
"react/jsx-runtime.js"
Expand Down

0 comments on commit 8083a57

Please sign in to comment.