-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* intial commit to test one job for Github actions * fix envs * exclude this branch while testing github actions * Copy the travis CI scripts and re-use for github actions * Overwite ruby with custom version. Add new checks in bash * run the unit tests now that setup is complete * fix old travis envs * add in step to print the logs * print logs on failure * Change the env BUILD_TYPE to GITHUB_JOB * Add in the linux integration steps and use the BUILD_TYPE vs the GITHUB_JOB env to id the build * use proper syntax for assigning envs via github actions * add docker integration tests * add and enable docker-compose COMPOSE_INTERACTIVE_NO_CLI for CI * Add the docker-compose setup script as the built-on github action docker-compose is not working * fix bash check for platform and build_type * add option to docker-compose to hopefully remove error on Github actions * Add and test out macos builds. Comment out linux builds for now as that's all working fine * For mac builds, use the tar.gz openstudio files as mac 10.15 is having errors trying to headless install the OpenStudio.dmg. Error msg: "Unable to create basic Accelerated OpenGL renderer." * install core utils for macos for building nokogiri * fix the tar * fix the curl output file name of OpenStudio * almost there. adding suffix * Setup is now working for osx. update the test.sh for osx * adding integration tests for macos * Use one job to string together the build, unit, integration and finally uploading gem packages. This should save some time with the uploading as we don't have to call the setup.sh again * fix yml * change -uses to uses * fixup mac export script * export to non repo dir and then cp back to repo dir * forgot to wrap var using bash * Adding in all final steps for docker, linux and mac builds and publishing * update push to docker hub * clean up and another condition for docker hub uploads for good measure to prevent accidental uploads * rename the github action file and add in checks for docker upload * Run on push and pull_request events * Restore the travis and appveyor CI jobs and fix export of osx on travis * remove all travis scripts and travis.yaml. Disabled project on travis-ci.org
- Loading branch information
Showing
15 changed files
with
267 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
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.1.0 | ||
OPENSTUDIO_VERSION_SHA: e165090621 | ||
OPENSTUDIO_VERSION_EXT: "" | ||
DOCKER_COMPOSE_VERSION: 1.21.1 | ||
BUNDLE_WITHOUT: native_ext | ||
|
||
|
||
jobs: | ||
linux-test: | ||
runs-on: ubuntu-18.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 | ||
- name: logs | ||
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-10.15 | ||
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 | ||
- name: logs | ||
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-18.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=develop | ||
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 | ||
docker-compose exec -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 | ||
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/setup_github_actions' | ||
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 }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# empty dir for export | ||
mkdir -p $GITHUB_WORKSPACE/build/NREL/export | ||
mkdir -p $HOME/build/NREL/export | ||
|
||
export PATH="/usr/loca/bin/ruby:/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/bin:${PATH}" | ||
export GEM_HOME="$GITHUB_WORKSPACE/gems" | ||
export GEM_PATH="$GITHUB_WORKSPACE/gems:$GITHUB_WORKSPACE/gems/bundler/gems" | ||
# Dir containing openstudio | ||
export RUBYLIB="/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/Ruby" | ||
export OPENSTUDIO_TEST_EXE="/usr/local/openstudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}/bin/openstudio" | ||
mongo_dir="/usr/bin" | ||
/usr/local/ruby/bin/ruby "${GITHUB_WORKSPACE}/bin/openstudio_meta" install_gems --export="${HOME}/build/NREL/export" | ||
oss_filename="OpenStudio-server-$(git -C "${GITHUB_WORKSPACE}" rev-parse --short=10 HEAD)-linux.tar.gz" | ||
ls -al $HOME/build/NREL/export/ | ||
# Build the gems and output to tar gz file. You need to specify a dir outside of the repo to export or | ||
# openstudio_meta will error. Then for sake of using relative dirs with GitHub upload-artifacts, cp the file to | ||
# the repo working directory. | ||
cp $HOME/build/NREL/export/$oss_filename $GITHUB_WORKSPACE/build/NREL/export/$oss_filename | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#empty dir for export | ||
mkdir -p $GITHUB_WORKSPACE/build/NREL/export | ||
mkdir -p $HOME/build/NREL/export | ||
|
||
|
||
export OS_NAME_WITH_PLUS=OpenStudio-${OPENSTUDIO_VERSION}${OPENSTUDIO_VERSION_EXT}+${OPENSTUDIO_VERSION_SHA}-Darwin | ||
export PATH="$GITHUB_WORKSPACE/gems/bin:/usr/local/ruby/bin:$HOME/$OS_NAME_WITH_PLUS/bin:$PATH" | ||
export RUBYLIB="$HOME/$OS_NAME_WITH_PLUS/Ruby" | ||
export GEM_HOME="$GITHUB_WORKSPACE/gems" | ||
export GEM_PATH="$GITHUB_WORKSPACE/gems:$GITHUB_WORKSPACE/gems/bundler/gems" | ||
oss_filename="OpenStudio-server-$(git -C "${GITHUB_WORKSPACE}" rev-parse --short=10 HEAD)-darwin.tar.gz" | ||
|
||
# Build the gems and output to tar gz file. You need to specify a dir outside of the repo to export or | ||
# openstudio_meta will error. Then for sake of using relative dirs with GitHub upload-artifacts, cp the file to | ||
# the repo working directory. | ||
/usr/local/ruby/bin/ruby "${GITHUB_WORKSPACE}/bin/openstudio_meta" install_gems --export="${HOME}/build/NREL/export" | ||
cp $HOME/build/NREL/export/$oss_filename $GITHUB_WORKSPACE/build/NREL/export/$oss_filename |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Current directory is $(pwd)" | ||
# echo "tree: ${TRAVIS_BUILD_DIR}/spec" | ||
# tree "${TRAVIS_BUILD_DIR}/spec" | ||
# echo "tree: ${GITHUB_WORKSPACE}/spec" | ||
# tree "${GITHUB_WORKSPACE}/spec" | ||
echo "=== PRINTING ERROR LOG REPORTS ===" | ||
|
||
shopt -s nullglob | ||
|
||
echo "=== PRINTING spec/files/logs/* ===" | ||
for F in "${TRAVIS_BUILD_DIR}/spec/files/logs/"* | ||
for F in "${GITHUB_WORKSPACE}/spec/files/logs/"* | ||
do | ||
echo '======================================================' | ||
echo $F | ||
echo '======================================================' | ||
# Limit the rate of printing the log (with pv) to keep travis happy. https://github.com/travis-ci/travis-ci/issues/6018 | ||
# Limit the rate of printing the log (with pv) | ||
cat $F | pv -q -L 3k | ||
echo | ||
done | ||
|
||
echo "=== PRINTING /spec/unit-test/logs/* ===" | ||
for F in "${TRAVIS_BUILD_DIR}/spec/unit-test/logs/"* | ||
for F in "${GITHUB_WORKSPACE}/spec/unit-test/logs/"* | ||
do | ||
echo '======================================================' | ||
echo $F | ||
echo '======================================================' | ||
# Limit the rate of printing the log (with pv) to keep travis happy. https://github.com/travis-ci/travis-ci/issues/6018 | ||
# Limit the rate of printing the log (with pv) | ||
cat $F | pv -q -L 3k | ||
echo | ||
done | ||
|
||
|
||
echo "=== PRINTING /spec/unit-test/logs/rails.log/* ===" | ||
for F in "${TRAVIS_BUILD_DIR}/spec/unit-test/logs/rails.log/"* | ||
for F in "${GITHUB_WORKSPACE}/spec/unit-test/logs/rails.log/"* | ||
do | ||
echo '======================================================' | ||
echo $F | ||
echo '======================================================' | ||
# Limit the rate of printing the log (with pv) to keep travis happy. https://github.com/travis-ci/travis-ci/issues/6018 | ||
# Limit the rate of printing the log (with pv) | ||
cat $F | pv -q -L 3k | ||
echo | ||
done |
Oops, something went wrong.