-
Notifications
You must be signed in to change notification settings - Fork 4
131 lines (123 loc) · 4.77 KB
/
ci.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
name: CI
on: [push, pull_request]
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.10']
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install radiance
run: |
wget https://github.com/LBNL-ETA/Radiance/releases/download/947ea88a/Radiance_947ea88a_Linux.zip
unzip Radiance_947ea88a_Linux.zip
tar -xzvf radiance-5.4.947ea88a29-Linux.tar.gz
sudo cp -r radiance-5.4.947ea88a29-Linux/usr/local/radiance/bin/* /usr/local/bin
sudo mkdir /usr/local/lib/ray
sudo cp -r radiance-5.4.947ea88a29-Linux/usr/local/radiance/lib/* /usr/local/lib/ray
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: run tests
run: python -m pytest --cov=. tests/
- name: run test coverage
if: ${{ matrix.python-version == 3.7 }}
run: |
echo "Coveralls is no longer supported"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy to GitHub and PyPI
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: set up node # we need node for for semantic release
uses: actions/[email protected]
with:
node-version: 14.17.0
- name: install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: install semantic-release
run:
npm install @semantic-release/exec
- name: run semantic release
id: new_release
run: |
nextRelease="`npx semantic-release@^17.0.0 --dryRun | grep -oP 'Published release \K.*? ' || true`"
npx semantic-release@^17.0.0
echo "::set-output name=tag::$nextRelease"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
- name: sleep for 5 minutes for PyPI update
if: contains(steps.new_release.outputs.tag, '.')
run: sleep 300s
shell: bash
- name: Update lbt-honeybee
if: contains(steps.new_release.outputs.tag, '.')
env:
DISPATCH_REPO: ladybug-tools/lbt-honeybee
DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }}
run: |
curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-d '{"event_type": "honeybee_radiance_postprocess_release", "client_payload": {"version": "${{ steps.new_release.outputs.tag }}"}}' \
-u ladybugbot:$DEPS_TOKEN
- name: Update pollination-honeybee-radiance-postprocess
if: contains(steps.new_release.outputs.tag, '.')
env:
DISPATCH_REPO: pollination/honeybee-radiance-postprocess
DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }}
run: |
curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-d '{"event_type": "honeybee_radiance_postprocess_release", "client_payload": {"version": "${{ steps.new_release.outputs.tag }}"}}' \
-u ladybugbot:$DEPS_TOKEN
docs:
name: Generate docs
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools'
steps:
- uses: actions/checkout@v2
- name: set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: install dependencies
run: |
pip install -U .
pip install -r dev-requirements.txt
sphinx-apidoc -f -e -d 4 -o ./docs ./honeybee_radiance_postprocess
sphinx-build -b html ./docs ./docs/_build/docs
- name: deploy to github pages
uses: peaceiris/actions-gh-pages@v3
with:
# this will use ladybugbot token
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: docs/_build/
force_orphan: true
keep_files: false
full_commit_message: 'deploy: update docs'