Skip to content

Add github workflow for tests #8

Add github workflow for tests

Add github workflow for tests #8

Workflow file for this run

name: Run tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Setup Conda
run: |
echo "/usr/share/miniconda3/bin" >> $GITHUB_PATH
source /usr/share/miniconda3/bin/activate
- name: Install dependencies
run: |
conda env create -f environment.yml
conda activate asp_plot
pip install .
- name: Test with pytest
run: |
conda activate asp_plot
pytest
- name: Cache Conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 1
with:
path: |
~/miniconda3/envs/asp_plot
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}-${{ env.CACHE_NUMBER }}