8000 Improve workflows by konradpabjan · Pull Request #88 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content

Improve workflows #88

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

Merged
merged 3 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improve workflows
  • Loading branch information
konradpabjan committed May 1, 2020
commit 3bb7ea113e766ab207def2e1f06bc0e7d8bdbca7
12 changes: 0 additions & 12 deletions .github/workflows/lint-yaml.yml

This file was deleted.

66 changes: 65 additions & 1 deletion .github/workflows/workflow.yml
8000
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Main workflow
on: [push, pull_request]
on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
run:
name: Run
Expand All @@ -24,3 +32,59 @@ jobs:

- name: 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.4
uses: ./
with:
python-version: 3.7.4
- name: Verify 3.7.4
run: python __tests__/verify-python.py 3.7.4

- name: Run with setup-python 3.6.2
uses: ./
with:
python-version: 3.6.2
- name: Verify 3.6.2
run: python __tests__/verify-python.py 3.6.2

- 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
22 changes: 22 additions & 0 deletions __tests__/verify-python.py
Original file line number Diff line number Diff line change
@@ -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 o 414B f arguments supplied")
print("Correct version of Python " + expectedVersion + " detected")
else:
raise Exception("Incorrect number of arguments supplied")
0