Merge pull request #50 from DeLaGuardo/refactoring

Small refactoring to simplify the check for incomplete input data
This commit is contained in:
Kirill Chernyshov 2022-06-10 11:35:04 +02:00 committed by GitHub
commit 9cd7303f70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3307 additions and 2918 deletions

View File

@ -178,3 +178,43 @@ jobs:
- name: Check clj-kondo version
run: clj-kondo --version
all-together:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '8'
- name: Install all the tools
# uses: DeLaGuardo/setup-clojure@master
uses: ./
with:
cli: latest
lein: latest
boot: latest
bb: latest
clj-kondo: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check Clojure CLI
run: clojure -Sdescribe
- name: Check leiningen version
run: lein version
- name: Check boot version
run: boot -V
- name: Check babashka version
run: bb --version
- name: Check clj-kondo version
run: clj-kondo --version

1222
dist/index.js vendored

File diff suppressed because it is too large Load Diff

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4902
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,26 +25,26 @@
"author": "DeLaGuardo",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/core": "^1.8.2",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^1.0.11",
"@actions/http-client": "^2.0.1",
"@actions/io": "^1.1.2",
"@actions/tool-cache": "^1.7.2"
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@types/jest": "^28.1.1",
"@types/node": "^17.0.41",
"@types/semver": "^7.3.9",
"@typescript-eslint/parser": "^5.18.0",
"@vercel/ncc": "^0.33.3",
"eslint": "^8.12.0",
"@typescript-eslint/parser": "^5.27.1",
"@vercel/ncc": "^0.34.0",
"eslint": "^8.17.0",
"eslint-plugin-github": "^4.3.6",
"eslint-plugin-jest": "^26.1.3",
"jest": "^27.5.1",
"jest-circus": "^27.5.1",
"eslint-plugin-jest": "^26.5.3",
"jest": "^28.1.1",
"jest-circus": "^28.1.1",
"js-yaml": "^4.1.0",
"prettier": "2.6.2",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
"ts-jest": "^28.0.4",
"typescript": "^4.7.3"
}
}

View File

@ -18,8 +18,10 @@ export async function run(): Promise<void> {
const githubToken = core.getInput('github-token')
const githubAuth = githubToken ? `token ${githubToken}` : undefined
const tools = []
if (LEIN_VERSION) {
lein.setup(LEIN_VERSION, githubAuth)
tools.push(lein.setup(LEIN_VERSION, githubAuth))
}
const IS_WINDOWS = utils.isWindows()
@ -28,44 +30,37 @@ export async function run(): Promise<void> {
if (IS_WINDOWS) {
throw new Error('Boot on windows is not supported yet.')
}
boot.setup(BOOT_VERSION, githubAuth)
tools.push(boot.setup(BOOT_VERSION, githubAuth))
}
if (CLI_VERSION) {
if (IS_WINDOWS) {
cli.setupWindows(CLI_VERSION)
tools.push(cli.setupWindows(CLI_VERSION))
} else {
cli.setup(CLI_VERSION)
tools.push(cli.setup(CLI_VERSION))
}
}
if (TDEPS_VERSION && !CLI_VERSION) {
if (IS_WINDOWS) {
cli.setupWindows(TDEPS_VERSION)
tools.push(cli.setupWindows(TDEPS_VERSION))
}
cli.setup(TDEPS_VERSION)
tools.push(cli.setup(TDEPS_VERSION))
}
if (BB_VERSION) {
await bb.setup(BB_VERSION, githubAuth)
tools.push(bb.setup(BB_VERSION, githubAuth))
}
if (CLJ_KONDO_VERSION) {
await cljKondo.setup(CLJ_KONDO_VERSION, githubAuth)
tools.push(cljKondo.setup(CLJ_KONDO_VERSION, githubAuth))
}
if (
!(
BOOT_VERSION ||
LEIN_VERSION ||
TDEPS_VERSION ||
CLI_VERSION ||
BB_VERSION ||
CLJ_KONDO_VERSION
)
) {
if (tools.length === 0) {
throw new Error('You must specify at least one clojure tool.')
}
await Promise.all(tools)
} catch (err) {
const error = err instanceof Error ? err.message : String(err)
core.setFailed(error)