Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a69c2bc7d | ||
|
|
654aa00a6e | ||
|
|
6f45e887f6 | ||
|
|
2989dc4a1a | ||
|
|
a0a76c4ddb | ||
|
|
2241d846ba | ||
|
|
807b74f98c | ||
|
|
5230712b36 | ||
|
|
4dda7a3aa1 | ||
|
|
9f521e1bf4 | ||
|
|
ee653cd47f | ||
|
|
c23f4218be | ||
|
|
f129643215 | ||
|
|
6cbb9cfdfd |
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**Which version of the action are you using?**
|
||||||
|
|
||||||
|
- [ ] `v1`
|
||||||
|
- [ ] `v2`
|
||||||
|
- [ ] Some other tag (such as `v2.0.1` or `master`)
|
||||||
|
|
||||||
|
**Environment**
|
||||||
|
- [ ] self-hosted
|
||||||
|
- [ ] Linux
|
||||||
|
- [ ] Windows
|
||||||
|
- [ ] Mac
|
||||||
|
|
||||||
|
If applicable, please specify if you're using a container
|
||||||
|
|
||||||
|
**Python Versions**
|
||||||
|
Please list all of the effected versions of Python (`3.8.2`, etc.)
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Run/Repo Url**
|
||||||
|
If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
name: "Code scanning - action"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
schedule:
|
||||||
|
- cron: '25 3 * * 5'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
CodeQL-Build:
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
# CodeQL runs on ubuntu-latest and windows-latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v1
|
||||||
|
# Override language selection by uncommenting this and choosing your languages
|
||||||
|
# with:
|
||||||
|
# languages: go, javascript, csharp, python, cpp, java
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v1
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 https://git.io/JvXDl
|
||||||
|
|
||||||
|
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||||
|
# and modify them (or add more) to build your code if your project
|
||||||
|
# uses a compiled language
|
||||||
|
|
||||||
|
#- run: |
|
||||||
|
# make bootstrap
|
||||||
|
# make release
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v1
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
name: Lint YAML
|
|
||||||
on: [pull_request]
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@master
|
|
||||||
- name: Lint action.yml
|
|
||||||
uses: ibiqlik/action-yamllint@master
|
|
||||||
with:
|
|
||||||
file_or_dir: action.yml
|
|
||||||
config_file: yaml-lint-config.yml
|
|
||||||
@@ -1,7 +1,13 @@
|
|||||||
name: Validate 'setup-python'
|
name: Validate 'setup-python'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 0 * * *
|
- cron: 0 0 * * *
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
name: Main workflow
|
name: Main workflow
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
@@ -24,3 +32,59 @@ jobs:
|
|||||||
|
|
||||||
- name: npm test
|
- name: npm test
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
|
- name: Run with setup-python 2.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 2.7
|
||||||
|
- name: Verify 2.7
|
||||||
|
run: python __tests__/verify-python.py 2.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.5
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.5
|
||||||
|
- name: Verify 3.5
|
||||||
|
run: python __tests__/verify-python.py 3.5
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.6
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.6
|
||||||
|
- name: Verify 3.6
|
||||||
|
run: python __tests__/verify-python.py 3.6
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
- name: Verify 3.7
|
||||||
|
run: python __tests__/verify-python.py 3.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.8
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.8
|
||||||
|
- name: Verify 3.8
|
||||||
|
run: python __tests__/verify-python.py 3.8
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.7.5
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.7.5
|
||||||
|
- name: Verify 3.7.5
|
||||||
|
run: python __tests__/verify-python.py 3.7.5
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.6.7
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.6.7
|
||||||
|
- name: Verify 3.6.7
|
||||||
|
run: python __tests__/verify-python.py 3.6.7
|
||||||
|
|
||||||
|
- name: Run with setup-python 3.8.1
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
python-version: 3.8.1
|
||||||
|
- name: Verify 3.8.1
|
||||||
|
run: python __tests__/verify-python.py 3.8.1
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import sys
|
||||||
|
argCount = len(sys.argv) - 1
|
||||||
|
|
||||||
|
if argCount == 1:
|
||||||
|
expectedVersion = sys.argv[1]
|
||||||
|
versions = len(expectedVersion.split("."))
|
||||||
|
majorMinor = str(sys.version_info[0]) + '.' + str(sys.version_info[1])
|
||||||
|
|
||||||
|
if versions == 2:
|
||||||
|
# Test only major and minor version
|
||||||
|
if expectedVersion != majorMinor:
|
||||||
|
raise Exception("Incorrect major + minor version detected\nExpected: " + expectedVersion + "\nActual: " + majorMinor)
|
||||||
|
elif versions == 3:
|
||||||
|
# Test major, minor and micro version
|
||||||
|
majorMinorMicro = majorMinor + '.' + str(sys.version_info[2])
|
||||||
|
if expectedVersion != majorMinorMicro:
|
||||||
|
raise Exception("Incorrect major + minor + micro version detected\nExpected: " + expectedVersion + "\nActual: " + majorMinorMicro)
|
||||||
|
else:
|
||||||
|
raise Exception("Incorrect number of arguments supplied")
|
||||||
|
print("Correct version of Python " + expectedVersion + " detected")
|
||||||
|
else:
|
||||||
|
raise Exception("Incorrect number of arguments supplied")
|
||||||
Vendored
+4143
-4096
File diff suppressed because it is too large
Load Diff
Generated
+8
-8
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-python",
|
"name": "setup-python",
|
||||||
"version": "1.0.0",
|
"version": "2.0.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
||||||
},
|
},
|
||||||
"@actions/exec": {
|
"@actions/exec": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz",
|
||||||
"integrity": "sha512-TogJGnueOmM7ntCi0ASTUj4LapRRtDfj57Ja4IhPmg2fls28uVOPbAn8N+JifaOumN2UG3oEO/Ixek2A4NcYSA==",
|
"integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/io": "^1.0.1"
|
"@actions/io": "^1.0.1"
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"@actions/tool-cache": {
|
"@actions/tool-cache": {
|
||||||
"version": "1.5.2",
|
"version": "1.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.5.5.tgz",
|
||||||
"integrity": "sha512-40A1St0GEo+QvHV1YRjStEoQcKKMaip+zNXPgGHcjYXCdZ7cl1LGlwOpsVVqwk+6ue/shFTS76KC1A02mVVCQA==",
|
"integrity": "sha512-y/YO37BOaXzOEHpvoGZDLCwvg6XZWQ7Ala4Np4xzrKD1r48mff+K/GAmzXMejnApU7kgqC6lL/aCKTZDCrhdmw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@actions/core": "^1.2.0",
|
"@actions/core": "^1.2.3",
|
||||||
"@actions/exec": "^1.0.0",
|
"@actions/exec": "^1.0.0",
|
||||||
"@actions/http-client": "^1.0.8",
|
"@actions/http-client": "^1.0.8",
|
||||||
"@actions/io": "^1.0.1",
|
"@actions/io": "^1.0.1",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-python",
|
"name": "setup-python",
|
||||||
"version": "1.0.0",
|
"version": "2.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Setup python action",
|
"description": "Setup python action",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"@actions/tool-cache": "^1.5.2",
|
"@actions/tool-cache": "^1.5.5",
|
||||||
"@types/jest": "^25.1.4",
|
"@types/jest": "^25.1.4",
|
||||||
"@types/node": "^12.12.31",
|
"@types/node": "^12.12.31",
|
||||||
"@types/semver": "^7.1.0",
|
"@types/semver": "^7.1.0",
|
||||||
|
|||||||
+19
-5
@@ -3,11 +3,14 @@ import * as core from '@actions/core';
|
|||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import {ExecOptions} from '@actions/exec/lib/interfaces';
|
import {ExecOptions} from '@actions/exec/lib/interfaces';
|
||||||
|
import {stderr} from 'process';
|
||||||
|
|
||||||
const AUTH_TOKEN = core.getInput('token');
|
const TOKEN = core.getInput('token');
|
||||||
|
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
|
||||||
const MANIFEST_REPO_OWNER = 'actions';
|
const MANIFEST_REPO_OWNER = 'actions';
|
||||||
const MANIFEST_REPO_NAME = 'python-versions';
|
const MANIFEST_REPO_NAME = 'python-versions';
|
||||||
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`;
|
const MANIFEST_REPO_BRANCH = 'main';
|
||||||
|
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
|
||||||
|
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
|
|
||||||
@@ -18,7 +21,8 @@ export async function findReleaseFromManifest(
|
|||||||
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
|
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
|
||||||
MANIFEST_REPO_OWNER,
|
MANIFEST_REPO_OWNER,
|
||||||
MANIFEST_REPO_NAME,
|
MANIFEST_REPO_NAME,
|
||||||
AUTH_TOKEN
|
AUTH,
|
||||||
|
MANIFEST_REPO_BRANCH
|
||||||
);
|
);
|
||||||
return await tc.findFromManifest(
|
return await tc.findFromManifest(
|
||||||
semanticVersionSpec,
|
semanticVersionSpec,
|
||||||
@@ -34,7 +38,10 @@ async function installPython(workingDirectory: string) {
|
|||||||
silent: true,
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data: Buffer) => {
|
stdout: (data: Buffer) => {
|
||||||
core.debug(data.toString().trim());
|
core.info(data.toString().trim());
|
||||||
|
},
|
||||||
|
stderr: (data: Buffer) => {
|
||||||
|
core.error(data.toString().trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -50,7 +57,7 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
|
|||||||
const downloadUrl = release.files[0].download_url;
|
const downloadUrl = release.files[0].download_url;
|
||||||
|
|
||||||
core.info(`Download from "${downloadUrl}"`);
|
core.info(`Download from "${downloadUrl}"`);
|
||||||
const pythonPath = await tc.downloadTool(downloadUrl, undefined, AUTH_TOKEN);
|
const pythonPath = await tc.downloadTool(downloadUrl, undefined, AUTH);
|
||||||
const fileName = path.basename(pythonPath, '.zip');
|
const fileName = path.basename(pythonPath, '.zip');
|
||||||
core.info('Extract downloaded archive');
|
core.info('Extract downloaded archive');
|
||||||
let pythonExtractedFolder;
|
let pythonExtractedFolder;
|
||||||
@@ -63,3 +70,10 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
|
|||||||
core.info('Execute installation script');
|
core.info('Execute installation script');
|
||||||
await installPython(pythonExtractedFolder);
|
await installPython(pythonExtractedFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isGhes(): boolean {
|
||||||
|
const ghUrl = new URL(
|
||||||
|
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
||||||
|
);
|
||||||
|
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user