-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (62 loc) · 1.67 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Build and test
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- "main"
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'
build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
name: build (${{ matrix.python-version }}, ${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
platform:
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
#
- name: Checkout the repository (commit)
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
#
- name: Checkout the repository (PR)
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request'
#
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: emle
environment-file: environment.yaml
miniforge-version: latest
#
- name: Install additional test dependencies
run: conda install pytest
#
- name: Install the package
run: pip install .
#
- name: Run the tests
run: python -m pytest -svvv --color=yes tests