From a2cb7153cbbd2ea37c5965afdc4b28523ba35beb Mon Sep 17 00:00:00 2001 From: staifa Date: Wed, 12 Apr 2023 14:47:57 +0200 Subject: [PATCH] Add CI pipeline --- .github/workflows/pipeline.yml | 37 ++++++++++++++++++++++++++++++++++ bin/ci | 2 +- bin/coverage | 2 +- bin/deploy | 2 +- bin/lint | 4 ++-- bin/local-install | 2 +- bin/nrepl | 2 +- bin/test | 2 +- bin/test-ns | 2 +- bin/test-var | 2 +- 10 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..622f23a --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,37 @@ +name: Lint, test, build and deploy + +on: + workflow_dispatch: + push: + +jobs: + ci-pipeline: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Clojure + uses: DeLaGuardo/setup-clojure@5.0 + with: + cli: 1.11.1.1113 + + - name: Cache clojure dependencies + uses: actions/cache@v3 + with: + path: | + ~/.m2/repository + ~/.gitlibs + ~/.deps.clj + key: cljdeps-${{ hashFiles('deps.edn') }} + restore-keys: cljdeps- + + - name: Run CI pipeline + run: ./bin/ci + + - name: Deploy to Clojars + if: startsWith(github.ref, 'refs/tags/v') + env: + CLOJARS_USERNAME: ${{ secrets.CLOJARS_LOGIN }} + CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} + run: ./bin/deploy diff --git a/bin/ci b/bin/ci index 426e261..14c2a9f 100755 --- a/bin/ci +++ b/bin/ci @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -T:build ci +clojure -T:build ci diff --git a/bin/coverage b/bin/coverage index abab1b5..12eb375 100755 --- a/bin/coverage +++ b/bin/coverage @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -M:coverage +clojure -M:coverage diff --git a/bin/deploy b/bin/deploy index 06069b9..b4db45c 100755 --- a/bin/deploy +++ b/bin/deploy @@ -6,5 +6,5 @@ elif [ -z "${CLOJARS_PASSWORD}" ]; then echo "CLOJARS_PASSWORD env var is not set" exit 1 else - clj -T:build deploy + clojure -T:build deploy fi diff --git a/bin/lint b/bin/lint index 94a44da..59356fe 100755 --- a/bin/lint +++ b/bin/lint @@ -1,3 +1,3 @@ #!/usr/bin/env sh -clj -M:kondo -clj -M:eastwood +clojure -M:kondo +clojure -M:eastwood diff --git a/bin/local-install b/bin/local-install index 64d297f..e8641f8 100755 --- a/bin/local-install +++ b/bin/local-install @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -T:build local-install +clojure -T:build local-install diff --git a/bin/nrepl b/bin/nrepl index 577a5ba..7e5def6 100755 --- a/bin/nrepl +++ b/bin/nrepl @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -M:nrepl "$@" +clojure -M:nrepl "$@" diff --git a/bin/test b/bin/test index 8f6258a..26bfce5 100755 --- a/bin/test +++ b/bin/test @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -X:test "$@" +clojure -X:test "$@" diff --git a/bin/test-ns b/bin/test-ns index 4c79c93..88b6401 100755 --- a/bin/test-ns +++ b/bin/test-ns @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -X:test :nses ["$@"] +clojure -X:test :nses ["$@"] diff --git a/bin/test-var b/bin/test-var index c1708df..be74be9 100755 --- a/bin/test-var +++ b/bin/test-var @@ -1,2 +1,2 @@ #!/usr/bin/env sh -clj -X:test :vars ["$@"] +clojure -X:test :vars ["$@"]