-
Notifications
You must be signed in to change notification settings - Fork 0
gha #35
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
base: master
Are you sure you want to change the base?
gha #35
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: 'Setup Leiningen' | ||
| description: 'Install system dependencies, JDK, and Leiningen for Clojure projects' | ||
| inputs: | ||
| java-version: | ||
| description: 'Java version to set up' | ||
| required: false | ||
| default: '17' | ||
| install-deps: | ||
| description: 'Whether to install Leiningen dependencies (lein deps and lein pom)' | ||
| required: false | ||
| default: 'false' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Install system dependencies | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gzip | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: ${{ inputs.java-version }} | ||
|
|
||
| - name: Install Leiningen | ||
| shell: bash | ||
| run: | | ||
| wget https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein | ||
| chmod +x lein | ||
| sudo mv lein /usr/local/bin/ | ||
| lein version | ||
|
|
||
| - name: Install Leiningen dependencies | ||
| if: inputs.install-deps == 'true' | ||
| shell: bash | ||
| run: | | ||
| lein deps | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step is redundant. It will run implicitly as part of |
||
| lein pom | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||
| name: CI | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: | ||||||
| - '**' | ||||||
| tags: | ||||||
| - '**' | ||||||
| pull_request: | ||||||
| branches: | ||||||
| - '**' | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
| name: "Build & Test" | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Leiningen | ||||||
| uses: ./.github/actions/setup-leiningen | ||||||
|
|
||||||
| - name: Run tests | ||||||
| run: lein test | ||||||
|
|
||||||
| test: | ||||||
| name: "Test (develop branch)" | ||||||
| runs-on: ubuntu-latest | ||||||
| if: github.ref == 'refs/heads/develop' | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Leiningen | ||||||
| uses: ./.github/actions/setup-leiningen | ||||||
| with: | ||||||
| install-deps: 'true' | ||||||
|
|
||||||
| - name: Run tests | ||||||
| run: lein test | ||||||
|
|
||||||
| publish: | ||||||
| name: "Publish to Clojars" | ||||||
| runs-on: ubuntu-latest | ||||||
| if: startsWith(github.ref, 'refs/tags/') | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout code | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Setup Leiningen | ||||||
| uses: ./.github/actions/setup-leiningen | ||||||
| with: | ||||||
| install-deps: 'true' | ||||||
|
|
||||||
| - name: Run tests | ||||||
| run: lein test | ||||||
|
|
||||||
| - name: Deploy to Clojars | ||||||
| env: | ||||||
| CLOJARS_USERNAME: ${{ vars.CLOJARS_USERNAME }} | ||||||
| CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD}} | ||||||
|
||||||
| CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD}} | |
| CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pin this version. Consider using https://github.com/DeLaGuardo/setup-clojure