-
Notifications
You must be signed in to change notification settings - Fork 8
82 lines (74 loc) · 1.84 KB
/
on-push.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
name: on-push
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
setup:
name: setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install -r requirements.txt
- run: python -m pip install .
test:
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
environment-file: environment.yml
python-version: 3.8
auto-activate-base: false
- name: Conda check
shell: bash -l {0}
run: |
conda info
conda list
- name: Install pyflow and test
shell: bash -l {0} # required to load conda I think
run: |
python -m pip install .
pytest
distribution:
runs-on: ubuntu-latest
needs: [setup, test]
steps:
- uses: actions/checkout@v3
- name: Build distributions
run: |
$CONDA/bin/python -m pip install build
$CONDA/bin/python -m build
- name: Publish a Python distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# notify:
# runs-on: ubuntu-latest
# needs:
# - setup
# - test
# - distribution
# if: always()
# steps:
# - name: Notify Teams
# uses: ecmwf-actions/notify-teams@v1
# with:
# incoming_webhook: ${{ secrets.incoming_webhook }}
# needs_context: ${{ toJSON(needs) }}