-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (70 loc) · 2.57 KB
/
test.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on:
push:
pull_request:
types: [opened]
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependencies
run: |
sudo python -m pip install --upgrade pip
sudo python -m pip install -e .
- name: Run Unit Tests
run: sudo python -m unittest
test-build-pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Twine and Build
run: sudo pip install twine build
- name: Create the distribution
run: |
git fetch --prune --unshallow --tags
sudo python -m build
test-build-conda:
runs-on: ubuntu-latest
# sets default shell to remove need for source to run the conda shell
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
miniconda-version: "latest"
- name: Install the Conda Dependencies
run: |
conda config --set always_yes yes --set auto_update_conda false
conda update conda
conda install -n base conda-libmamba-solver
conda install python=3.10 conda-build colorama pip ruamel ruamel.yaml rich jsonschema -c conda-forge
git fetch --prune --unshallow --tags
pip install -e .
- name: Build the Anaconda Package
id: condabuild
run: |
conda install anaconda-client
conda config --set anaconda_upload no --set solver libmamba
VERSION_FROM_GIT_TAG=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-) conda build . -c conda-forge
echo "gitversion=$(git tag --list "v*[0-9]" --sort=version:refname | tail -1 | cut -c 2-)" >> $GITHUB_OUTPUT