enhencement:main yml
pip install and python matrix added for Github actions
@@ -8,7 +8,7 @@ on:
push:
branches: [ master ]
pull_request:
- branches: [ master ]
+ branches: [ _any_ ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@@ -17,14 +17,29 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: [3.5, 3.6]
+
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
+ # Ref: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ # You can test your matrix by printing the current Python version
+ - name: Display Python version
+ run: python -c "import sys; print(sys.version)"
+
# Cache the pip requirmenets for other tests. If requirements cached use them to speed up the build.
# Ref: https://github.com/actions/cache/blob/main/examples.md#python---pip
- - uses: actions/cache@v2
+ - name: Cache pip Linux
+ uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
@@ -32,7 +47,8 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- - uses: actions/cache@v2
+ - name: Cache pip MacOS
+ uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
@@ -40,7 +56,8 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- - uses: actions/cache@v2
+ - name: Cache pip Windows
+ uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
@@ -48,6 +65,11 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world! Welcome PyElastica Build, let's start testing!
