diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..485548dc9 Binary files /dev/null and b/.DS_Store differ diff --git a/.github/workflows/workflow.yml b/.github/workflows/myworkflow.yml similarity index 82% rename from .github/workflows/workflow.yml rename to .github/workflows/myworkflow.yml index 22e0e0605..e856b166e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/myworkflow.yml @@ -1,12 +1,12 @@ -name: Main workflow -on: [push] +name: new workflow +on: [pull_request, push] jobs: run: name: Run runs-on: ${{ matrix.operating-system }} strategy: matrix: - operating-system: [ubuntu-latest, windows-latest] + operating-system: [ubuntu-latest] steps: - name: Checkout uses: actions/checkout@master diff --git a/__tests__/finder.test.ts b/__tests__/finder.test.ts index 6b44caedd..fb31da646 100644 --- a/__tests__/finder.test.ts +++ b/__tests__/finder.test.ts @@ -1,4 +1,5 @@ import io = require('@actions/io'); +import exec = require('@actions/exec'); import fs = require('fs'); import path = require('path'); @@ -29,30 +30,7 @@ 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'); + await exec.exec('python', ['--version']); }); }); diff --git a/foo b/foo new file mode 100644 index 000000000..e69de29bb diff --git a/package-lock.json b/package-lock.json index 725db1548..b59ef17d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1735,8 +1735,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -1757,14 +1756,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1779,20 +1776,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -1909,8 +1903,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -1922,7 +1915,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -1937,7 +1929,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -1945,14 +1936,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -1971,7 +1960,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -2052,8 +2040,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -2065,7 +2052,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -2151,8 +2137,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -2188,7 +2173,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -2208,7 +2192,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -2252,14 +2235,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/src/find-python.ts b/src/find-python.ts index 2721ba312..6b53ae8b4 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -73,9 +73,9 @@ function usePyPy(majorVersion: 2 | 3, architecture: string): void { // On Linux and macOS, the Python interpreter is in 'bin'. // On Windows, it is in the installation root. const pythonLocation = IS_WINDOWS ? installDir : _binDir; - core.exportVariable('pythonLocation', pythonLocation); + // core.exportVariable('pythonLocation', pythonLocation); - core.addPath(installDir); + // core.addPath(installDir); core.addPath(_binDir); }