Skip to content

Commit

Permalink
Merge branch 'actions:main' into update-contributors-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
e-korolevskii authored Aug 10, 2022
2 parents e6a9a96 + 37b00c4 commit 2f75d1d
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: npm

- name: Install dependencies
run: npm ci
run: npm ci --ignore-scripts

- name: Rebuild the dist/ directory
run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/licensed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Check licenses
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm ci --ignore-scripts
- name: Install licensed
run: |
cd $RUNNER_TEMP
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
with:
node-version: 16.x
cache: npm
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run build
- run: npm run format-check
- run: npm test
- name: Verify no unstaged changes
if: runner.os != 'windows'
run: __tests__/verify-no-unstaged-changes.sh

test-setup-multiple-versions:
runs-on: ${{ matrix.operating-system }}
strategy:
Expand All @@ -50,9 +50,9 @@ jobs:
uses: ./
with:
dotnet-version: |
2.2.402
3.1.404
3.0.x
2.2.402
3.1.404
3.0.x
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 2.2.402 3.1.404 '3.0'
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- name: Verify dotnet
shell: pwsh
run: __tests__/verify-dotnet.ps1 3.1 2.2

test-setup-latest-patch-version:
runs-on: ${{ matrix.operating-system }}
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format
5 changes: 5 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

# Tests are not run at push time since they can take 2-4 minutes to complete
npm run format-check
1 change: 1 addition & 0 deletions __tests__/setup-dotnet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('setup-dotnet tests', () => {
process.env.RUNNER_TOOL_CACHE = toolDir;
process.env.DOTNET_INSTALL_DIR = toolDir;
process.env.RUNNER_TEMP = tempDir;
process.env['INPUT_INCLUDE-PRERELEASE'] = 'false';
await io.rmRF(toolDir);
await io.rmRF(tempDir);
});
Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ inputs:
include-prerelease:
description: 'Whether prerelease versions should be matched with non-exact versions (for example 5.0.0-preview.6 being matched by 5, 5.0, 5.x or 5.0.x). Defaults to false if not provided.'
required: False
default: 'false'
runs:
using: 'node16'
main: 'dist/index.js'
3 changes: 1 addition & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,7 @@ function run() {
}
}
if (versions.length) {
const includePrerelease = (core.getInput('include-prerelease') || 'false').toLowerCase() ===
'true';
const includePrerelease = core.getBooleanInput('include-prerelease');
let dotnetInstaller;
for (const version of new Set(versions)) {
dotnetInstaller = new installer.DotnetCoreInstaller(version, includePrerelease);
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@
"build": "tsc && ncc build",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"prepare": "husky install",
"test": "jest",
"update-installers": "nwget https://dot.net/v1/dotnet-install.ps1 -O externals/install-dotnet.ps1 && nwget https://dot.net/v1/dotnet-install.sh -O externals/install-dotnet.sh"
},
"husky": {
"hooks": {
"//": "Tests are not run at push time since they can take 2-4 minutes to complete",
"pre-commit": "npm run format",
"pre-push": "npm run format-check"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/setup-dotnet.git"
Expand All @@ -44,7 +38,7 @@
"@types/node": "^16.11.25",
"@types/semver": "^6.2.2",
"@vercel/ncc": "^0.33.4",
"husky": "^7.0.2",
"husky": "^8.0.1",
"jest": "^27.2.5",
"jest-circus": "^27.2.5",
"prettier": "^1.19.1",
Expand Down
6 changes: 3 additions & 3 deletions src/setup-dotnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export async function run() {
}

if (versions.length) {
const includePrerelease: boolean =
(core.getInput('include-prerelease') || 'false').toLowerCase() ===
'true';
const includePrerelease: boolean = core.getBooleanInput(
'include-prerelease'
);
let dotnetInstaller!: installer.DotnetCoreInstaller;
for (const version of new Set<string>(versions)) {
dotnetInstaller = new installer.DotnetCoreInstaller(
Expand Down

0 comments on commit 2f75d1d

Please sign in to comment.