Update main.yml #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI for Cool-Graph | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up Miniconda | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| auto-activate-base: true # This automatically configures the shell for Conda | |
| python-version: 3.8 | |
| - name: | |
| shell: bash -l {0} | |
| run: | | |
| conda env create --file environment.yml --name cool-graph-env | |
| conda activate cool-graph-env | |
| conda info | |
| - name: Run tests | |
| shell: bash -l {0} | |
| run: | | |
| conda activate cool-graph-env | |
| pytest | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up Miniconda | |
| uses: conda-incubator/setup-miniconda@v2 | |
| with: | |
| auto-activate-base: true | |
| python-version: 3.8 | |
| - name: Create environment for release | |
| shell: bash -l {0} | |
| run: | | |
| conda env create --file environment.yml --name cool-graph-env | |
| conda activate cool-graph-env | |
| conda info | |
| - name: Build and publish package | |
| shell: bash -l {0} | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| conda activate cool-graph-env | |
| python setup.py sdist bdist_wheel | |
| python -m twine upload dist/* |