Skip to content

Commit

Permalink
Merge pull request #89 from DeLaGuardo/migrate-to-gh-releases
Browse files Browse the repository at this point in the history
Migrate to GH releases for Clojure CLI
  • Loading branch information
DeLaGuardo authored Sep 6, 2023
2 parents 1c76ab0 + fdcd988 commit 15c9fc8
Show file tree
Hide file tree
Showing 14 changed files with 2,978 additions and 2,375 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,32 @@ jobs:
- name: Install Clojure CLI
uses: ./
with:
cli: 1.10.1.693
cli: 1.11.1.1409

- name: Execute clojure code
run: clojure -e "(+ 1 1)"

test-clojure-cli-latest:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@main

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'

- name: Install Clojure CLI
uses: ./
with:
cli: latest

- name: Execute clojure code
run: clojure -e "(+ 1 1)"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
java-version: '8'

- name: Install clojure tools
uses: DeLaGuardo/setup-clojure@11.0
uses: DeLaGuardo/setup-clojure@12.0
with:
# Install just one or all simultaneously
# The value must indicate a particular version of the tool, or use 'latest'
Expand Down
20 changes: 14 additions & 6 deletions __tests__/tdeps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ jest.mock('@actions/http-client', () => {
return {
HttpClient: jest.fn().mockImplementation(() => {
return {
get: jest.fn().mockImplementation(() => {
getJson: jest.fn().mockImplementation(() => {
return {
readBody: jest.fn().mockResolvedValue('1.2.3 123qwe')
result: {
tag_name: '1.2.3'
}
}
})
}
Expand Down Expand Up @@ -76,7 +78,9 @@ describe('tdeps tests', () => {
await tdeps.setup('1.10.1.469')

expect(tc.downloadTool).toHaveBeenCalledWith(
'https://download.clojure.org/install/linux-install-1.10.1.469.sh'
'https://download.clojure.org/install/linux-install-1.10.1.469.sh',
undefined,
undefined
)
expect(io.mkdirP).toHaveBeenCalledWith('/tmp/usr/local/opt/ClojureTools')
expect(exec.exec).toHaveBeenCalledWith('bash', [
Expand Down Expand Up @@ -105,7 +109,9 @@ describe('tdeps tests', () => {
await tdeps.setup('latest')

expect(tc.downloadTool).toHaveBeenCalledWith(
'https://download.clojure.org/install/linux-install-1.2.3.sh'
'https://download.clojure.org/install/linux-install-1.2.3.sh',
undefined,
undefined
)
expect(io.mkdirP).toHaveBeenCalledWith('/tmp/usr/local/opt/ClojureTools')
expect(exec.exec).toHaveBeenCalledWith('bash', [
Expand Down Expand Up @@ -136,10 +142,12 @@ describe('tdeps tests', () => {
tc.downloadTool.mockResolvedValueOnce(downloadPath)
tc.cacheDir.mockResolvedValueOnce(cachePath)

await tdeps.setup('latest')
await tdeps.setup('latest', 'foo')

expect(tc.downloadTool).toHaveBeenCalledWith(
'https://download.clojure.org/install/linux-install-1.2.3.sh'
'https://download.clojure.org/install/linux-install-1.2.3.sh',
undefined,
'foo'
)
expect(io.mkdirP).toHaveBeenCalledWith('/tmp/usr/local/opt/ClojureTools')
expect(fs.writeFile).toHaveBeenCalledWith(
Expand Down
269 changes: 222 additions & 47 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 15c9fc8

Please sign in to comment.