-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup GitHub actions #617
Merged
Merged
Setup GitHub actions #617
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
44eb576
intial commit to test one job for Github actions
tijcolem 6540fa5
fix envs
tijcolem 7a1237d
exclude this branch while testing github actions
tijcolem db22467
Copy the travis CI scripts and re-use for github actions
tijcolem 5fb3ae8
Overwite ruby with custom version. Add new checks in bash
tijcolem c4fe2b3
run the unit tests now that setup is complete
tijcolem b6f2dd2
fix old travis envs
tijcolem d38eb00
add in step to print the logs
tijcolem 923a70c
print logs on failure
tijcolem 5d86045
Change the env BUILD_TYPE to GITHUB_JOB
tijcolem 90d1e5a
Add in the linux integration steps and use the BUILD_TYPE vs the GITH…
tijcolem 0f4f5cd
use proper syntax for assigning envs via github actions
tijcolem 8f6617c
add docker integration tests
tijcolem ba61a78
add and enable docker-compose COMPOSE_INTERACTIVE_NO_CLI for CI
tijcolem 91a298e
Add the docker-compose setup script as the built-on github action doc…
tijcolem 82a0fcb
fix bash check for platform and build_type
tijcolem 2596a93
add option to docker-compose to hopefully remove error on Github actions
tijcolem 847f2aa
Add and test out macos builds. Comment out linux builds for now as th…
tijcolem a9d1ac9
For mac builds, use the tar.gz openstudio files as mac 10.15 is havin…
tijcolem d0e4b30
install core utils for macos for building nokogiri
tijcolem 967c12d
fix the tar
tijcolem 74b3f08
fix the curl output file name of OpenStudio
tijcolem f398f4b
almost there. adding suffix
tijcolem ec414f0
Setup is now working for osx. update the test.sh for osx
tijcolem 4faa85b
adding integration tests for macos
tijcolem 55f01ae
Use one job to string together the build, unit, integration and final…
tijcolem 2c2b45c
fix yml
tijcolem 8f930a7
change -uses to uses
tijcolem 691c8e3
fixup mac export script
tijcolem 052d003
export to non repo dir and then cp back to repo dir
tijcolem 16abb9f
forgot to wrap var using bash
tijcolem 04d8041
Adding in all final steps for docker, linux and mac builds and publis…
tijcolem 0cce6b0
update push to docker hub
tijcolem d6b61be
clean up and another condition for docker hub uploads for good measur…
tijcolem 156181f
rename the github action file and add in checks for docker upload
tijcolem bd5aa82
Run on push and pull_request events
tijcolem ed36e92
Restore the travis and appveyor CI jobs and fix export of osx on travis
tijcolem da15e12
remove all travis scripts and travis.yaml. Disabled project on travis…
tijcolem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sweet! finally building package from the CI! |
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍