-
Notifications
You must be signed in to change notification settings - Fork 20
134 lines (129 loc) · 3.95 KB
/
openstudio-server-tests.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
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
132
133
134
name: openstudio-server
on: [push, pull_request]
# example of how to restrict to one branch and push event
#on:
# push:
# branches:
# - test_branch
env:
USE_TESTING_TIMEOUTS: "true"
OPENSTUDIO_VERSION: 3.7.0
OPENSTUDIO_VERSION_SHA: 211bb633b0
OPENSTUDIO_VERSION_EXT: "-rc1"
DOCKER_COMPOSE_VERSION: 1.21.1
BUNDLE_WITHOUT: native_ext
jobs:
linux-test:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
- name: unit-test
shell: bash
run: ./ci/github-actions/test.sh
env:
BUILD_TYPE: test
- name: integration
shell: bash
run: ./ci/github-actions/test.sh
env:
BUILD_TYPE: integration
SKIP_URBANOPT_ALGO: true # Set this when excluding urbanopt-cli gem from server.
- name: logs
if: ${{ failure() }}
shell: bash
run: ./ci/github-actions/print_logs.sh
- name: build gem package
if: ${{ success() }}
shell: bash
run: ./ci/github-actions/export_build_linux.sh
- name: upload gem package
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: openstudio-server-gems-linux
path: build/NREL/export/*.tar.gz
macos-test:
runs-on: macos-11
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
- name: unit-test
shell: bash
run: ./ci/github-actions/test.sh
env:
BUILD_TYPE: test
- name: integration
shell: bash
run: ./ci/github-actions/test.sh
env:
BUILD_TYPE: integration
SKIP_URBANOPT_ALGO: true # Set this when excluding urbanopt-cli gem from server.
- name: logs
if: ${{ failure() }}
shell: bash
run: ./ci/github-actions/print_logs.sh
- name: build gem package
if: ${{ success() }}
shell: bash
run: ./ci/github-actions/export_build_osx.sh
- name: upload gem package
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: openstudio-server-gems-darwin
path: build/NREL/export/*.tar.gz
docker:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: setup
shell: bash
run: ./ci/github-actions/setup.sh
env:
BUILD_TYPE: docker
- name: docker
shell: bash
run: |
export OPENSTUDIO_TAG=3.7.0-rc1
sed -i -E "s/.git//g" .dockerignore
docker volume create --name=osdata
docker images --all
docker --version
docker-compose --version
docker-compose -f docker-compose.test.yml pull
docker-compose -f docker-compose.test.yml build --build-arg OPENSTUDIO_VERSION=$OPENSTUDIO_TAG
docker-compose -f docker-compose.test.yml up -d
# set SKIP_URBANOPT_ALGO=true to skip UrbanOpt algo tests
docker-compose exec -e SKIP_URBANOPT_ALGO=false -T web /usr/local/bin/run-server-tests
docker-compose stop
git checkout -- .dockerignore && git checkout -- Dockerfile
env:
CI: true
OS_SERVER_NUMBER_OF_WORKERS: 4
BUILD_TYPE: docker
COMPOSE_INTERACTIVE_NO_CLI: 1
- name: logs
if: ${{ failure() }}
shell: bash
run: ./ci/github-actions/print_logs.sh
- name: docker-upload
if: |
github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/develop'
shell: bash
run: ./docker/deployment/scripts/deploy_docker_github_actions.sh
env:
CI: true
BUILD_TYPE: docker
# On forked Pull Requests secrets will not be sent to the runner. See more info here:
# https://docs.github.com/en/actions/reference/encrypted-secrets
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}