-
Notifications
You must be signed in to change notification settings - Fork 36
57 lines (55 loc) · 2.11 KB
/
public-ci.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
name: CI
on: [push]
jobs:
test:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install CI deps
run: |
pip install --upgrade pip setuptools wheel
pip install shapely -f ${{ secrets.CI_PIP_INDEX_URL }}/simple/shapely/index.html
- name: Build wheel
run: |
pip wheel --no-deps --wheel-dir wheels -e .
pip install -e .[complete,tests]
- name: Test Client
env:
TMPDIR: tempdir
DESCARTESLABS_ENV: testing
run: |
mkdir tempdir
pytest -rfExXP --assert=plain --ignore-glob="*/smoke_tests" --ignore-glob="*/e2e" --ignore="descarteslabs/core/third_party" descarteslabs
rm -r tempdir
- name: Test CLI
env:
TMPDIR: tempdir
DESCARTESLABS_ENV: testing
run: |
mkdir tempdir
descarteslabs version
rm -r tempdir
slack:
runs-on: ubuntu-latest
needs: [test]
if: ${{ always() && github.ref_name == 'master' }}
steps:
- name: Webhook
env:
EMOJI: ${{ needs.test.result == 'success' && ':party-hat:' || ':boom:' }}
STATUS: ${{ needs.test.result == 'success' && 'succeeded!' || 'failed.' }}
run: |
message=`sed "s/'/\\\\\\\\'/g" <<'!'
${{ github.event.commits[0].message }}
!
`
PAYLOAD='{"text":"${{ env.EMOJI }} CI testing of ${{ github.event.repository.full_name }} has ${{ env.STATUS }}\nCommit <${{ github.event.commits[0].url }}|${{ github.sha }}> by ${{ github.event.commits[0].author.name }}: '"$message"'\n<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Test results>"}'
curl -s -X POST -H "Content-Type: application/json" -d "$PAYLOAD" ${{ secrets.slack_webhook }}