From a5e33db36f8130765fa118442a086655b032330b Mon Sep 17 00:00:00 2001 From: Milton Reder Date: Thu, 7 Dec 2023 11:56:27 -0500 Subject: [PATCH] Add gh actions --- .github/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/deps.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/deps.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..d60c2d0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: Clojars Deployment + +on: + push: + tags: + - 'v*.*.*' # Enforce Semantic Versioning + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup CD Environment + uses: yetanalytics/actions/setup-env@v0.0.4 + + - name: Extract version + id: version + run: echo version=${GITHUB_REF#refs\/tags\/v} >> $GITHUB_OUTPUT + + - name: Build and deploy to Clojars + uses: yetanalytics/actions/deploy-clojars@v0.0.4 + with: + artifact-id: 'lrs-reactions' + version: ${{ steps.version.outputs.version }} + clojars-username: ${{ secrets.CLOJARS_USERNAME }} + clojars-deploy-token: ${{ secrets.CLOJARS_DEPLOY_TOKEN }} + src-dirs: '["src"]' diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml new file mode 100644 index 0000000..c5acaac --- /dev/null +++ b/.github/workflows/deps.yml @@ -0,0 +1,30 @@ +name: Deps + +on: + push: + branches: + - '*' +jobs: + deps: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout project + uses: actions/checkout@v3 + + - name: Setup CI Environment + uses: yetanalytics/action-setup-env@v1 + + - name: Cache Deps + uses: actions/cache@v3 + with: + path: | + ~/.m2 + ~/.gitlibs + key: ${{ runner.os }}-deps-${{ hashFiles('deps.edn') }} + restore-keys: | + ${{ runner.os }}-deps- + - name: Force pom generation + run: make ci + - name: Submit Dependency Snapshot + uses: advanced-security/maven-dependency-submission-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..74dc63e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: + push: + branches: + - '*' +jobs: + deps: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout project + uses: actions/checkout@v3 + + - name: Setup CI Environment + uses: yetanalytics/action-setup-env@v1 + + - name: Cache Deps + uses: actions/cache@v3 + with: + path: | + ~/.m2 + ~/.gitlibs + key: ${{ runner.os }}-deps-${{ hashFiles('deps.edn') }} + restore-keys: | + ${{ runner.os }}-deps- + - name: Run Tests + run: make run-tests