Skip to content

Commit

Permalink
Merge pull request #20 from toyokumo/develop
Browse files Browse the repository at this point in the history
Bump outdated libraries
  • Loading branch information
liquidz authored Apr 3, 2024
2 parents 32cf5ab + eff97d7 commit 995df5a
Show file tree
Hide file tree
Showing 28 changed files with 4,163 additions and 3,038 deletions.
39 changes: 0 additions & 39 deletions .circleci/config.yml

This file was deleted.

13 changes: 13 additions & 0 deletions .cljstyle.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{:rules {:indentation {:list-indent 1
:indents {#"^(.*/)?def.*" [[:inner 0]]
#"^(.*/)?with-" [[:inner 0]]
defrecord [[:inner 0] [:inner 1]]
cond-> [[:inner 0]]}}
:comments {:enabled? false}
:blank-lines {:insert-padding? false
:trim-consecutive? true}
:vars {:enabled? false}
:functions {:enabled? false}
:types {:enabled? false}
:namespaces {:indent-size 1}}
:files {:ignore #{"out" "target"}}}
72 changes: 72 additions & 0 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Lint and Test

on: push

jobs:
clj_style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeLaGuardo/setup-clojure@master
with:
cljstyle: latest
- run: make format-check

clj_kondo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeLaGuardo/setup-clojure@master
with:
clj-kondo: latest
- run: make lint

test:
needs: [clj_style, clj_kondo]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
java-package: jdk
architecture: x64

- uses: DeLaGuardo/setup-clojure@master
with:
lein: '2.11.2'

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8

- uses: actions/setup-node@v4
with:
node-version: '18.16.1'
cache: pnpm

- name: Show versions
run: |
java -version
lein version
pnpm -v
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.m2
~/.lein
key: clj-cache-test-${{ hashFiles('project.clj') }}
restore-keys: |
clj-cache-test-
- run: pnpm i --frozen-lockfile

- name: Run tests
run: make test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ pom.xml.asc
.hg/
.idea/
dev-resources/config.edn
.clj-kondo/.cache
/node_modules
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
.PHONY: test

lint:
clj-kondo --lint src:test

format-check:
cljstyle check --report -v

clean:
lein clean

Expand Down
15 changes: 8 additions & 7 deletions dev/cljs/user.cljs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(ns cljs.user
(:require [cljs-test-display.core]
[figwheel.main.testing :refer-macros [run-tests run-tests-async]]
;; require all the namespaces that have tests in them
[kintone-client.authentication-test]
[kintone-client.connection-test]
[kintone-client.record-test]
[kintone-client.url-test]))
(:require
[cljs-test-display.core]
[figwheel.main.testing :refer-macros [run-tests run-tests-async]]
;; require all the namespaces that have tests in them
[kintone-client.authentication-test]
[kintone-client.connection-test]
[kintone-client.record-test]
[kintone-client.url-test]))

(goog-define ^boolean DEBUG false)

Expand Down
57 changes: 28 additions & 29 deletions dev/test.clj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
(ns test
(:require [clojure.core.async :refer [<!! <! chan go-loop timeout]]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.test :refer :all]
[kintone-client.app :as app]
[kintone-client.user :as user]
[kintone-client.authentication :as auth]
[kintone-client.connection :as conn]
[kintone-client.record :as record]
[clojure.string :as str]))
(:require
[clojure.core.async :refer [<!! <! chan go-loop timeout]]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.test :refer :all]
[kintone-client.app :as app]
[kintone-client.authentication :as auth]
[kintone-client.connection :as conn]
[kintone-client.record :as record]
[kintone-client.user :as user]))

(def conf (edn/read-string (slurp "dev-resources/config.edn")))

Expand Down Expand Up @@ -67,21 +68,21 @@
(deftest file-upload-filename-mojibake-test
(testing "japanese filename"
(with-cleanup
(let [upload-file-key (-> (<!! (record/file-upload conn (io/file "dev-resources/日本語ファイル名.txt")))
:res
:fileKey)
record-id (-> (<!! (record/add-record conn app {string-field-code {:value "file name test"}
attachment-file-field-code {:value [{:fileKey upload-file-key}]}}))
:res
:id)
file-name (-> (<!! (record/get-record conn app record-id))
:res
:record
attachment-file-field-code
:value
first
:name)]
(is (= "日本語ファイル名.txt" file-name)))))
(let [upload-file-key (-> (<!! (record/file-upload conn (io/file "dev-resources/日本語ファイル名.txt")))
:res
:fileKey)
record-id (-> (<!! (record/add-record conn app {string-field-code {:value "file name test"}
attachment-file-field-code {:value [{:fileKey upload-file-key}]}}))
:res
:id)
file-name (-> (<!! (record/get-record conn app record-id))
:res
:record
attachment-file-field-code
:value
first
:name)]
(is (= "日本語ファイル名.txt" file-name)))))
(testing "ascii filename"
(with-cleanup
(let [upload-file-key (-> (<!! (record/file-upload conn (io/file "dev-resources/ascii-filename.txt")))
Expand Down Expand Up @@ -684,8 +685,7 @@
:res
:properties
(contains? :TEXT1)
not)))
))
not)))))

(deftest get-app-deploy-status-test
(with-app app
Expand Down Expand Up @@ -855,8 +855,7 @@
:entity {:type "GROUP", :code "everyone"},
:recordAddable true,
:recordEditable true}]
(:rights res)))
))
(:rights res)))))

(deftest update-acl-test
(with-app app
Expand Down
3 changes: 2 additions & 1 deletion dev/user.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns user
(:require [figwheel.main.api :as fig]))
(:require
[figwheel.main.api :as fig]))

(defn fig-start []
(fig/start "dev"))
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"devDependencies": {
"karma": "^6.4.2",
"karma-chrome-launcher": "^3.2.0",
"karma-cli": "^2.0.0",
"karma-cljs-test": "^0.1.0"
}
}
Loading

0 comments on commit 995df5a

Please sign in to comment.