-
Notifications
You must be signed in to change notification settings - Fork 580
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
Consume toolkit from npmjs #12
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
!node_modules/ | ||
__tests__/runner/* | ||
!node_modules/ | ||
__tests__/runner/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2018 GitHub, Inc. and contributors | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
|
||
The MIT License (MIT) | ||
|
||
Copyright (c) 2018 GitHub, Inc. and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
# setup-python | ||
<p align="left"> | ||
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a> | ||
</p> | ||
This action sets up a python environment for use in actions by: | ||
- optionally installing a version of python and adding to PATH. Note that this action only uses versions of Python already installed in the cache. The action will fail if no matching versions are found. | ||
- registering problem matchers for error output | ||
# Usage | ||
See [action.yml](action.yml) | ||
Basic: | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' # Version range or exact version of a Python version to use, using semvers version range syntax. | ||
architecture: 'x64' # (x64 or x86) | ||
- run: python my_script.py | ||
``` | ||
Matrix Testing: | ||
```yaml | ||
jobs: | ||
build: | ||
runs-on: ubuntu-16.04 | ||
strategy: | ||
matrix: | ||
python: [ '2.x', '3.x', 'pypy3' ] | ||
name: Python ${{ matrix.python }} sample | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x64 | ||
- run: python my_script.py | ||
``` | ||
# License | ||
The scripts and documentation in this project are released under the [MIT License](LICENSE) | ||
# Contributions | ||
Contributions are welcome! See [Contributor's Guide](docs/contributors.md) | ||
# setup-python | ||
|
||
<p align="left"> | ||
<a href="https://github.com/actions/setup-python"><img alt="GitHub Actions status" src="https://github.com/actions/setup-python/workflows/Main%20workflow/badge.svg"></a> | ||
</p> | ||
|
||
This action sets up a python environment for use in actions by: | ||
|
||
- optionally installing a version of python and adding to PATH. Note that this action only uses versions of Python already installed in the cache. The action will fail if no matching versions are found. | ||
- registering problem matchers for error output | ||
|
||
# Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
Basic: | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' # Version range or exact version of a Python version to use, using semvers version range syntax. | ||
architecture: 'x64' # (x64 or x86) | ||
- run: python my_script.py | ||
``` | ||
|
||
Matrix Testing: | ||
```yaml | ||
jobs: | ||
build: | ||
runs-on: ubuntu-16.04 | ||
strategy: | ||
matrix: | ||
python: [ '2.x', '3.x', 'pypy3' ] | ||
name: Python ${{ matrix.python }} sample | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: x64 | ||
- run: python my_script.py | ||
``` | ||
|
||
# License | ||
|
||
The scripts and documentation in this project are released under the [MIT License](LICENSE) | ||
|
||
# Contributions | ||
|
||
Contributions are welcome! See [Contributor's Guide](docs/contributors.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
import io = require('@actions/io'); | ||
import fs = require('fs'); | ||
import path = require('path'); | ||
const toolDir = path.join( | ||
__dirname, | ||
'runner', | ||
path.join( | ||
Math.random() | ||
.toString(36) | ||
.substring(7) | ||
), | ||
'tools' | ||
); | ||
const tempDir = path.join( | ||
__dirname, | ||
'runner', | ||
path.join( | ||
Math.random() | ||
.toString(36) | ||
.substring(7) | ||
), | ||
'temp' | ||
); | ||
process.env['RUNNER_TOOL_CACHE'] = toolDir; | ||
process.env['RUNNER_TEMP'] = tempDir; | ||
import * as finder from '../src/find-python'; | ||
describe('Finder tests', () => { | ||
it('Finds Python if it is installed', async () => { | ||
const pythonDir: string = path.join(toolDir, 'Python', '3.0.0', 'x64'); | ||
await io.mkdirP(pythonDir); | ||
fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
await finder.findPythonVersion('3.x', 'x64'); | ||
}); | ||
it('Errors if Python is not installed', async () => { | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
let thrown = false; | ||
try { | ||
await finder.findPythonVersion('3.300000', 'x64'); | ||
} catch { | ||
thrown = true; | ||
} | ||
expect(thrown).toBeTruthy(); | ||
}); | ||
it('Finds PyPy if it is installed', async () => { | ||
const pythonDir: string = path.join(toolDir, 'PyPy', '2.0.0', 'x64'); | ||
await io.mkdirP(pythonDir); | ||
fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
await finder.findPythonVersion('pypy2', 'x64'); | ||
}); | ||
}); | ||
import io = require('@actions/io'); | ||
import fs = require('fs'); | ||
import path = require('path'); | ||
|
||
const toolDir = path.join( | ||
__dirname, | ||
'runner', | ||
path.join( | ||
Math.random() | ||
.toString(36) | ||
.substring(7) | ||
), | ||
'tools' | ||
); | ||
const tempDir = path.join( | ||
__dirname, | ||
'runner', | ||
path.join( | ||
Math.random() | ||
.toString(36) | ||
.substring(7) | ||
), | ||
'temp' | ||
); | ||
|
||
process.env['RUNNER_TOOL_CACHE'] = toolDir; | ||
process.env['RUNNER_TEMP'] = tempDir; | ||
|
||
import * as finder from '../src/find-python'; | ||
|
||
describe('Finder tests', () => { | ||
it('Finds Python if it is installed', async () => { | ||
const pythonDir: string = path.join(toolDir, 'Python', '3.0.0', 'x64'); | ||
await io.mkdirP(pythonDir); | ||
fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
await finder.findPythonVersion('3.x', 'x64'); | ||
}); | ||
|
||
it('Errors if Python is not installed', async () => { | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
let thrown = false; | ||
try { | ||
await finder.findPythonVersion('3.300000', 'x64'); | ||
} catch { | ||
thrown = true; | ||
} | ||
expect(thrown).toBeTruthy(); | ||
}); | ||
|
||
it('Finds PyPy if it is installed', async () => { | ||
const pythonDir: string = path.join(toolDir, 'PyPy', '2.0.0', 'x64'); | ||
await io.mkdirP(pythonDir); | ||
fs.writeFileSync(`${pythonDir}.complete`, 'hello'); | ||
// This will throw if it doesn't find it in the cache (because no such version exists) | ||
await finder.findPythonVersion('pypy2', 'x64'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
name: 'Setup Python environment' | ||
description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support' | ||
author: 'GitHub' | ||
inputs: | ||
python-version: | ||
description: 'Version range or exact version of a Python version to use, using semvers version range syntax.' | ||
default: '3.x' | ||
architecture: | ||
description: 'The target architecture (x86, x64) of the Python interpreter.' | ||
default: 'x64' | ||
# Deprecated option, do not use. Will not be supported after October 1, 2019 | ||
version: | ||
description: 'Deprecated. Use python-version instead. Will not be supported after October 1, 2019' | ||
runs: | ||
using: 'node12' | ||
main: 'lib/setup-python.js' | ||
name: 'Setup Python environment' | ||
description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support' | ||
author: 'GitHub' | ||
inputs: | ||
python-version: | ||
description: 'Version range or exact version of a Python version to use, using semvers version range syntax.' | ||
default: '3.x' | ||
architecture: | ||
description: 'The target architecture (x86, x64) of the Python interpreter.' | ||
default: 'x64' | ||
# Deprecated option, do not use. Will not be supported after October 1, 2019 | ||
version: | ||
description: 'Deprecated. Use python-version instead. Will not be supported after October 1, 2019' | ||
runs: | ||
using: 'node12' | ||
main: 'lib/setup-python.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# Contributors | ||
### Checkin | ||
- Do checkin source (src) | ||
- Do checkin build output (lib) | ||
- Do checkin runtime node_modules | ||
- Do not checkin devDependency node_modules (husky can help see below) | ||
### devDependencies | ||
In order to handle correctly checking in node_modules without devDependencies, we run [Husky](https://github.com/typicode/husky) before each commit. | ||
This step ensures that formatting and checkin rules are followed and that devDependencies are excluded. To make sure Husky runs correctly, please use the following workflow: | ||
``` | ||
npm install # installs all devDependencies including Husky | ||
git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above) | ||
git commit -m "Informative commit message" # Commit. This will run Husky | ||
``` | ||
During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) as well as pruning out devDependencies using `npm prune --production`. | ||
# Contributors | ||
|
||
### Checkin | ||
|
||
- Do checkin source (src) | ||
- Do checkin build output (lib) | ||
- Do checkin runtime node_modules | ||
- Do not checkin devDependency node_modules (husky can help see below) | ||
|
||
### devDependencies | ||
|
||
In order to handle correctly checking in node_modules without devDependencies, we run [Husky](https://github.com/typicode/husky) before each commit. | ||
This step ensures that formatting and checkin rules are followed and that devDependencies are excluded. To make sure Husky runs correctly, please use the following workflow: | ||
|
||
``` | ||
npm install # installs all devDependencies including Husky | ||
git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above) | ||
git commit -m "Informative commit message" # Commit. This will run Husky | ||
``` | ||
|
||
During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) as well as pruning out devDependencies using `npm prune --production`. | ||
It will also make sure these changes are appropriately included in your commit (no further work is needed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
moduleFileExtensions: ['js', 'ts'], | ||
testEnvironment: 'node', | ||
testMatch: ['**/*.test.ts'], | ||
testRunner: 'jest-circus/runner', | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest' | ||
}, | ||
verbose: true | ||
module.exports = { | ||
clearMocks: true, | ||
moduleFileExtensions: ['js', 'ts'], | ||
testEnvironment: 'node', | ||
testMatch: ['**/*.test.ts'], | ||
testRunner: 'jest-circus/runner', | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest' | ||
}, | ||
verbose: true | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there a line endings issue?
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.
Yes, but I think it might actually be the fault of the repo not this PR. I ran
git add * --renormalize
on all of these PRs, this is the only one that had issues. Renormalize just readds the files with the configuration you have on your machine. In my case, I havecore.autocrlf
set to true, which means it will get added withLF
endings (which is what we want)