diff --git a/.github/workflows/code-quality-main.yaml b/.github/workflows/code-quality-main.yaml deleted file mode 100644 index 47cfbcd..0000000 --- a/.github/workflows/code-quality-main.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Same as `code-quality-pr.yaml` but triggered on commit to main branch -# and runs on all files (instead of only the changed ones) - -name: Code Quality Main - -on: - push: - branches: [main] - -jobs: - code-quality: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Run pre-commits - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/code-quality-pr.yaml b/.github/workflows/code-quality-pr.yaml deleted file mode 100644 index 7f65b89..0000000 --- a/.github/workflows/code-quality-pr.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow finds which files were changed, prints them, -# and runs `pre-commit` on those files. - -# Inspired by the sktime library: -# https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml - -name: Code Quality PR - -on: - pull_request: - branches: [main, "release/*", "dev"] - -jobs: - code-quality: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.9" - - - name: Find modified files - id: file_changes - uses: trilom/file-changes-action@v1.2.4 - with: - output: " " - - - name: List modified files - run: echo '${{ steps.file_changes.outputs.files}}' - - - name: Run pre-commits - uses: pre-commit/action@v2.0.3 - with: - extra_args: --files ${{ steps.file_changes.outputs.files}} diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 0000000..0e1555a --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,20 @@ +# Use one pre-commit config +# Further information at https://github.com/pre-commit/action + +name: Code Quality + +on: + pull_request: + branches: [main, "release/*", "dev"] + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test-env.yaml b/.github/workflows/test-env.yaml index f80dc60..f7bbd35 100644 --- a/.github/workflows/test-env.yaml +++ b/.github/workflows/test-env.yaml @@ -1,3 +1,7 @@ +# Helpful resources: +# 1.) https://autobencoder.com/2020-08-24-conda-actions/ +# 2.) https://github.com/conda-incubator/setup-miniconda + name: Test Env on: @@ -14,15 +18,17 @@ jobs: fail-fast: false matrix: # os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Openslide not available via conda on Windows - os: ["ubuntu-latest", "macos-latest"] + os: ["ubuntu-latest"] + defaults: + run: + shell: bash -el {0} # Need to adjust shell to remember profile steps: - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v3 with: - activate-environment: test + activate-environment: anaconda-client-env environment-file: environment.yaml auto-activate-base: false - - shell: bash -l {0} - run: | + - run: | conda info conda list