Skip to content

Merge pull request #781 from NREL/reduce-analyses #955

Merge pull request #781 from NREL/reduce-analyses

Merge pull request #781 from NREL/reduce-analyses #955

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.6.1
OPENSTUDIO_VERSION_SHA: bb9481519e
OPENSTUDIO_VERSION_EXT: ""
DOCKER_COMPOSE_VERSION: 1.21.1
BUNDLE_WITHOUT: native_ext
jobs:
linux-test:
runs-on: ubuntu-20.04
steps:
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- 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-13
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: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- 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.6.1
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=true -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' ||
github.ref == 'refs/heads/3.6.1-3'
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 }}