Skip to content

Commit

Permalink
Fix CI (#640)
Browse files Browse the repository at this point in the history
* Update requirements-dev-raw.txt

* update tests

* recovery

* upgrade tests

* Update CI.yml

* Revert "Update CI.yml"

This reverts commit 343476f.

* update tests

* update tests

* update CI

* update CI

* update CI

---------

Co-authored-by: He Sichao <[email protected]>
  • Loading branch information
chaoming0625 and Routhleck authored Mar 2, 2024
1 parent 5112f25 commit 26d09c5
Show file tree
Hide file tree
Showing 26 changed files with 1,548 additions and 2,570 deletions.
147 changes: 43 additions & 104 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ permissions:
contents: read # to fetch code
actions: write # to cancel previous workflows


#on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
# This is what will cancel the workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
Expand All @@ -30,14 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/cancel-workflow-action@0.12.1
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -53,125 +53,64 @@ jobs:
cd brainpy
pytest _src/
test_linux_with_taichi_numba:
runs-on: ubuntu-latest
test_macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest taichi numba
if [ -f requirements-dev-raw.txt ]; then pip install -r requirements-dev-raw.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd brainpy
pytest _src/
test_macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest -n auto --tb=short _src/
test_windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
os: [ win-2019-16core ]
arch: [ AMD64 ]
python-version: ["3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # ratchet: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest _src/
test_macos_with_taichi_numba:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest taichi numba
if [ -f requirements-dev-raw.txt ]; then pip install -r requirements-dev-raw.txt; fi
pip uninstall brainpy -y
python setup.py install
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 brainpy/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 brainpy/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
cd brainpy
pytest _src/
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Print concurrency group
run: echo '${{ github.workflow }}-${{ github.ref }}'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
pip uninstall brainpy -y
python setup.py install
- name: Test with pytest
run: |
cd brainpy
pytest _src/
Loading

0 comments on commit 26d09c5

Please sign in to comment.