diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..621ef15 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,55 @@ +name: Test + +on: [push, pull_request] + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Cache conda + uses: actions/cache@v4 + env: + CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed + with: + path: ~/conda_pkgs_dir + key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} + + - name: Setup Conda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + environment-file: environment.yml + + - name: Install Docker + uses: docker-practice/actions-setup-docker@master + + - name: Install Poetry + uses: abatilo/actions-poetry@v3 + with: + poetry-version: 1.8.5 + + - name: Install dependencies + shell: bash -l {0} + run: | + poetry env info + poetry install + pip list + + - name: Run tests + run: | + poetry run pytest -s