Skip to content

Commit

Permalink
fix: run ci on all branches but only release from master
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Jan 18, 2024
1 parent 4b887ac commit 9e0f977
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
on:
push:
branches:
- master
name: release-please
jobs:
continuous-integration:
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -24,22 +22,23 @@ jobs:
shell: bash -l {0}
run: |
conda install -c loop3d --file dependencies.txt -y
- name: Checking formatting of code
shell: bash -l {0}
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 map2loop --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 map2loop --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Building and install
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 map2loop --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 map2loop --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Building and install
shell: bash -l {0}
run: |
pip install .
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
Expand All @@ -59,7 +58,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"] # , "macos-latest"]
os: ["ubuntu-latest", "windows-latest"] # , "macos-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: conda-incubator/setup-miniconda@v2
Expand All @@ -69,41 +68,41 @@ jobs:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true

- uses: actions/checkout@v2
- name: update submodules
run: |
git submodule update --init --recursive
git submodule update --init --recursive
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/[email protected]
uses: microsoft/[email protected]
- name: Conda build'
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda install conda-build
conda install -c loop3d --file dependencies.txt -y
conda build -c loop3d --no-test --python ${{ matrix.python-version }} --output-folder conda conda
conda install anaconda-client -y
conda install conda-build
conda install -c loop3d --file dependencies.txt -y
conda build -c loop3d --no-test --python ${{ matrix.python-version }} --output-folder conda conda
conda install anaconda-client -y
- name: upload windows
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/win-64/*.tar.bz2
anaconda upload --label main conda/win-64/*.tar.bz2
- name: upload linux
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/linux-64/*.tar.bz2
anaconda upload --label main conda/linux-64/*.tar.bz2
- name: upload macosx
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/osx-64/*.tar.bz2
anaconda upload --label main conda/osx-64/*.tar.bz2

0 comments on commit 9e0f977

Please sign in to comment.