Clean before publishing package (#1) #3
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a | |
# single version of Python | |
# For more information see: | |
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Test & Lint | |
on: | |
push: | |
branches: [ "main", "stagging" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Set up Miniconda | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: 3.11 | |
# Create and activate Conda environment | |
- name: Create and activate environment | |
run: | | |
conda create --name synutils-env python=3.11 -y | |
conda activate synutils-env | |
pip install flake8 pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
shell: bash -l {0} | |
# Lint with flake8 | |
- name: Lint with flake8 | |
run: | | |
conda activate synutils-env | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
./lint.sh | |
shell: bash -l {0} | |
# Test with pytest | |
- name: Test with pytest | |
run: | | |
conda activate synutils-env | |
pytest Test | |
shell: bash -l {0} |