bugfix:main.yml
Main yml is fixed and now it should do the job.
name: CI
-# Controls when the action will run. Triggers the workflow on push or pull request
-# events but only for the master branch
+# Controls when the action will run. Triggers the workflow on push request
+# events for the master branch, and pull request events for all branches.
on:
push:
branches: [ master ]
@@ -15,11 +15,12 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }} #ubuntu-latest
strategy:
matrix:
- python-version: [3.6] #[3.6, 3.7]
+ os: [ubuntu-latest] # [ubuntu-latest, macos-latest] # Run macos tests if really required, since they charge 10 times more for macos
+ python-version: [3.6, 3.7, 3.8]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
@@ -46,7 +47,6 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
-
- name: Cache pip MacOS
uses: actions/cache@v2
if: startsWith(runner.os, 'macOS')
@@ -64,36 +64,44 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
-
- name: Install dependencies
run: |
+ echo update pip
python -m pip install --upgrade pip
+ echo update requirments
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ echo update test requirements
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
# Runs a single command using the runners shell
- - name: Run a one-line script
+ - name: Welcome message
run: echo Hello, world! Welcome PyElastica Build, lets start testing!
# Formatting test with black and flake8
- name: Black and Flake8 formatting tests
run: |
- if ((${{ matrix.python-version }} == 3.6)); then
+ if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
black --version
black --check elastica tests
flake8 --version
flake8 elastica tests
fi
-# # Test Pyelastica using pytest
-# - name: Test PyElastica using pytest
-# run: |
-# if [${{ matrix.python-version }} == 3.6]; then
-# python3 -m pytest --cov=elastica --cov-report=xml;
-
+ # Set environment variables for coverage test. Coverage test is done using python 3.6
+ # For the coverage test we disable numba jit compilation, since it prevents generating coverage data.
+ - name: Set environment variables for coverage test
+ run: |
+ if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
+ echo "NUMBA_DISABLE_JIT=1" >> $GITHUB_ENV
+ echo "CODECOV_TOKEN=94895f9a-26ac-4621-8091-2a2d04dd7e87" >> $GITHUB_ENV
+ fi
- # Runs a set of commands using the runners shell
- - name: Run a multi-line script
+ # Test Pyelastica using pytest
+ - name: Test PyElastica using pytest
run: |
- echo Add other actions to build,
- echo test, and deploy your project.
+ if [[ "${{ matrix.python-version }}" == "3.6" ]]; then
+ python3 -m pytest --cov=elastica --cov-report=xml
+ codecov
+ else
+ python3 -m pytest
+ fi
