-
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,36 @@ | ||
| 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' | ||
|
Comment on lines
+8
to
+11
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 appears to be unused. |
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Install system dependencies | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y gzip | ||
|
Comment on lines
+15
to
+19
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. I don't think this is needed |
||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: ${{ inputs.java-version }} | ||
|
|
||
| - name: Install Leiningen | ||
| uses: DeLaGuardo/setup-clojure@13.0 | ||
| with: | ||
| lein: 'latest' | ||
|
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. Versions must all be pinned. |
||
|
|
||
| - name: Install Leiningen dependencies | ||
| if: inputs.install-deps == 'true' | ||
| shell: bash | ||
| run: | | ||
| lein pom | ||
|
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. Again, action versions should be pinned with ratchet. |
| 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 }} | ||
| run: lein deploy |
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.
All actions should be pinned to a specific commit using ratchet. This is something infosec has requested for all GHA.