Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Clojure CLI & GitHub Actions #117

Merged
merged 6 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 0 additions & 172 deletions .circleci/config.yml

This file was deleted.

13 changes: 12 additions & 1 deletion .clj-kondo/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,15 @@
:lint-as
{potemkin.types/deftype+ clojure.core/deftype}

:skip-comments true}
:skip-comments true

:ns-groups
[{:pattern ".*-test$"
:name tests}]

:config-in-ns
{tests
{:linters
{:inline-def {:level :off}
:missing-docstring {:level :off}
:shadowed-var {:level :off}}}}}
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
ignore-words-list = CLOS,clos,befores,edn,juxt
skip = *#,./target/*
25 changes: 14 additions & 11 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
((nil . ((indent-tabs-mode . nil) ; always use spaces for tabs
((nil . ((indent-tabs-mode . nil) ; always use spaces for tabs
(require-final-newline . t))) ; add final newline on save
(clojure-mode . (;; prefer keeping source width about ~118, GitHub seems to cut off stuff at either 119 or 120 and
;; it's nicer to look at code in GH when you don't have to scroll back and forth
(fill-column . 118)
(clojure-docstring-fill-column . 118)
(eval . (define-clojure-indent
(p.types/defprotocol+ '(1 (:defn)))
(p.types/definterface+ '(1 (:defn)))
(p.types/def-abstract-type '(1 (:defn)))
(p.types/deftype+ '(2 nil nil (:defn)))
(p.types/defrecord+ '(2 nil nil (:defn))))))))
(clojure-mode . ((cider-preferred-build-tool . clojure-cli)
(cider-clojure-cli-aliases . "dev")
(fill-column . 120)
(clojure-docstring-fill-column . 120)
(eval . (put 'p/defprotocol+ 'clojure-doc-string-elt 2))
(eval . (put 'p.types/defprotocol+ 'clojure-doc-string-elt 2))
(eval . (put-clojure-indent 'p.types/defprotocol+ '(1 (:defn))))
(eval . (put-clojure-indent 'p.types/definterface+ '(1 (:defn))))
(eval . (put-clojure-indent 'p.types/def-abstract-type '(1 (:defn))))
;; (eval . (put-clojure-indent 'p.types/deftype+ '(2 nil nil (:defn))))
;; (eval . (put-clojure-indent 'p.types/defrecord+ '(2 nil nil (:defn))))
(eval . (put-clojure-indent 'with-meta '(:form)))
(eval . (put-clojure-indent 'with-bindings* '(:form))))))
13 changes: 5 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
Thanks for contributing to Methodical. Before open a pull request, please take a moment to:

- [ ] Ensure the PR follows the [Clojure Style Guide](https://github.com/bbatsov/clojure-style-guide).
- [ ] Tests and linters pass. You can run them locally as follows:
- [ ] Tests and linters pass. You can run all of the tests and linters locally with

lein test && lein lint
./scripts/lint-and-test.sh

CircleCI will also run these same tests against your PR.
GitHub Actions will also run these same tests against your PR.
- [ ] Make sure you've included new tests for any new features or bugfixes.
- [ ] New features are documented, or documentation is updated appropriately for any changed features.
- [ ] Carefully review your own changes and revert any superfluous ones. (A good example would be moving words in the
Markdown documentation to different lines in a way that wouldn't change how the rendered page itself would
appear. These sorts of changes make a PR bigger than it needs to be, and, thus, harder to review.)

Of course, indentation and typo fixes are not covered by this rule and are always appreciated.
Of course, indentation and typo fixes are not covered by this rule and are always appreciated.
- [ ] Include a detailed explanation of what changes you're making and why you've made them. This will help me
understand what's going on while we review it.

Once you've done all that, open a PR! Make sure to at-mention @camsaul in the PR description. Otherwise I won't get an
email about it and might not get review it right away. :)

Thanks for your contribution!
Once you've done all that, open a PR! Thanks for your contribution!
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-20.04
environment: Deployment
steps:
- uses: actions/checkout@v3
- name: Prepare JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
cli: 1.11.1.1155
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
key: deploy
- name: Build JAR
run: clojure -T:build build
env:
GITHUB_SHA: ${{ env.GITHUB_SHA }}
- name: Deploy to Clojars
run: clojure -T:build deploy
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
12 changes: 0 additions & 12 deletions .github/workflows/linters.yml

This file was deleted.

Loading