Skip to content

Commit

Permalink
Further condensing uses statments into 1 action
Browse files Browse the repository at this point in the history
  • Loading branch information
schuylermartin45 committed Oct 23, 2023
1 parent 1984c4d commit 6ed0cc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/actions/setup-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ description: Set up an anaconda-linter environment
runs:
using: "composite"
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: '3.9'
cache: 'pip'
- name: Cache conda env
id: cache-conda
uses: actions/[email protected]
env:
cache-name: conda-env-cache
with:
cache: 'pip'
path: '/usr/share/miniconda/envs'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/environment.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Create Environment
shell: bash
if: ${{ steps.cache-conda.outputs.cache-hit == false }}
run: |
conda update -n base -c defaults conda
Expand All @@ -25,4 +32,3 @@ runs:
conda env create -f environment.yaml --name anaconda-linter --force
conda run --name anaconda-linter pip install .
conda activate anaconda-linter
shell: bash
7 changes: 0 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: '3.9'
cache: 'pip'
- uses: ./.github/actions/setup-env
- uses: pre-commit/[email protected]
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup-env
- name: Run tests
run: |
Expand Down Expand Up @@ -56,7 +50,6 @@ jobs:
lint-recipe:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: ./.github/actions/setup-env
- name: Run lint
run: |
Expand Down

0 comments on commit 6ed0cc1

Please sign in to comment.