Skip to content
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

Swapping to Actions from Travis #742

Merged
merged 50 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
89de303
Create main.yml
Robbie1977 Nov 2, 2020
1398641
fix branch
Robbie1977 Nov 2, 2020
859d592
Merge pull request #1 from Robbie1977/Robbie1977-patch-1
Robbie1977 Nov 2, 2020
608bd7f
Update main.yml
Robbie1977 Nov 2, 2020
6b25cd5
Update main.yml
Robbie1977 Nov 2, 2020
4686538
typo fix
Robbie1977 Nov 2, 2020
a8425e8
Update main.yml
Robbie1977 Nov 2, 2020
84fde8f
Update main.yml
Robbie1977 Nov 2, 2020
03de294
Update main.yml
Robbie1977 Nov 2, 2020
a4bd8f7
Update main.yml
Robbie1977 Nov 2, 2020
51c9cdf
Update main.yml
Robbie1977 Nov 2, 2020
23f615f
Update main.yml
Robbie1977 Nov 2, 2020
4edf032
typo fix
Robbie1977 Nov 2, 2020
23c907e
Update main.yml
Robbie1977 Nov 2, 2020
f42f798
Update main.yml
Robbie1977 Nov 2, 2020
0dcc9a0
Update main.yml
Robbie1977 Nov 2, 2020
1d56269
adding build
Robbie1977 Nov 2, 2020
4f5ee4e
Update main.yml
Robbie1977 Nov 2, 2020
5345f64
test with fixed
Robbie1977 Nov 2, 2020
e2dbfe7
multiple builds
Robbie1977 Nov 3, 2020
138225b
try with step value
Robbie1977 Nov 3, 2020
c4be65a
space fix
Robbie1977 Nov 3, 2020
a034cf3
Update main.yml
Robbie1977 Nov 3, 2020
09a64ad
change name
Robbie1977 Nov 3, 2020
6fd9660
add test
Robbie1977 Nov 3, 2020
852a24d
test
Robbie1977 Nov 3, 2020
596f651
merged
Robbie1977 Nov 3, 2020
269be6a
remove server
Robbie1977 Nov 3, 2020
4b51c33
adding server
Robbie1977 Nov 3, 2020
f34c305
typo fix
Robbie1977 Nov 3, 2020
305aa86
start test and stop
Robbie1977 Nov 3, 2020
0316ea2
add landing page
Robbie1977 Nov 3, 2020
d1373b7
add first batch of tests
Robbie1977 Nov 3, 2020
68a3185
splitting
Robbie1977 Nov 3, 2020
22aeb9f
adding delay
Robbie1977 Nov 3, 2020
3b9cb06
output logs
Robbie1977 Nov 3, 2020
849bf23
typo fix
Robbie1977 Nov 3, 2020
d293951
adding all tests
Robbie1977 Nov 3, 2020
e770df4
split out wait step
Robbie1977 Nov 3, 2020
ea4ab50
Rename .travis.yml to NoLongerUsed.travis.yml
Robbie1977 Nov 3, 2020
5bd711f
add review section
Robbie1977 Nov 3, 2020
65e1764
cleaning up
Robbie1977 Nov 3, 2020
88ea5ac
adding build timeouts
Robbie1977 Nov 3, 2020
a860d44
order fix
Robbie1977 Nov 3, 2020
670b2be
name fix
Robbie1977 Nov 3, 2020
db3ace0
allowing fail on review
Robbie1977 Nov 3, 2020
24225fb
Merge pull request #740 from Robbie1977/debug
Robbie1977 Nov 3, 2020
a18ac83
checking branch is passed correctly
Robbie1977 Nov 3, 2020
da52b76
fix on all
Robbie1977 Nov 3, 2020
e67a2ef
swapping to actions
Robbie1977 Nov 3, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push only. ToDo: handle pull requests for testing only
on:
push:
branches: '*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Deploy the local and remote versions of geppetto-vfb
deploy-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# total job timeout:
timeout-minutes: 45

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Decide based on branch which servers to use
- name: Pass branch
id: branch
run: echo "::set-output name=value::${GITHUB_REF##*/}";
- name: Setup local servers
id: local-servers
shell: bash
run: if [ "${GITHUB_REF##*/}" == master ] ; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] ; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-dev.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-dev.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::development";
elif [ "${GITHUB_REF##*/}" == alpha ] ; then
echo "::debug::Set to alpha setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-alpha.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-alpha.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::staging";
else
echo "::debug::Set to default setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb:7474";
echo "::set-output name=VFB_OWL_SERVER::http://owl:8080/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://ocpu:80/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
fi
- name: Setup remote servers
id: remote-servers
shell: bash
run: if [ "${GITHUB_REF##*/}" == master ] ; then
echo "::debug::Set to master setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb.virtualflybrain.org";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] ; then
echo "::debug::Set to dev setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb-dev.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl-dev.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-dev.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-dev.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
elif [ "${GITHUB_REF##*/}" == alpha ] ; then
echo "::debug::Set to alpha setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb-alpha.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl-alpha.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb-alpha.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr-alpha.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
else
echo "::debug::Set to default setup";
echo "::set-output name=VFB_PDB_SERVER::http://pdb.virtualflybrain.org";
echo "::set-output name=VFB_OWL_SERVER::http://owl.virtualflybrain.org/kbs/vfb/";
echo "::set-output name=VFB_R_SERVER::http://r.virtualflybrain.org/ocpu/library/vfbr/R/vfb_nblast";
echo "::set-output name=VFB_TREE_PDB_SERVER::https://pdb.virtualflybrain.org";
echo "::set-output name=SOLR_SERVER::https://solr.virtualflybrain.org/solr/ontology/select";
echo "::set-output name=BUILD_TYPE::release";
fi

# Output the chosen servers
- name: Used remote servers
run: |
echo PDB:${{ steps.remote-servers.outputs.VFB_PDB_SERVER }}
echo OWL:${{ steps.remote-servers.outputs.VFB_OWL_SERVER }}
echo SOLR:${{ steps.remote-servers.outputs.SOLR_SERVER }}
echo TREE_PDB:${{ steps.remote-servers.outputs.VFB_TREE_PDB_SERVER }}
echo R:${{ steps.remote-servers.outputs.VFB_R_SERVER }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push local wss
id: docker_build_local
timeout-minutes: 10
uses: docker/build-push-action@v2
with:
push: true
tags: "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-local.wss"
build-args: |
VFB_TREE_PDB_SERVER_ARG=${{ steps.local-servers.outputs.VFB_TREE_PDB_SERVER }}
SOLR_SERVER_ARG=${{ steps.local-servers.outputs.SOLR_SERVER }}
VFB_R_SERVER_ARG=${{ steps.local-servers.outputs.VFB_R_SERVER }}
VFB_OWL_SERVER_ARG=${{ steps.local-servers.outputs.VFB_OWL_SERVER }}
VFB_PDB_SERVER_ARG=${{ steps.local-servers.outputs.VFB_PDB_SERVER }}
build_type=${{ steps.local-servers.outputs.BUILD_TYPE }}
targetBranch=${{ steps.branch.outputs.value }}
originBranch=${{ steps.branch.outputs.value }}
defaultBranch=development
finalBuild=true

- name: Build and push remote
id: docker_build_remote
timeout-minutes: 10
uses: docker/build-push-action@v2
with:
push: true
tags: "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-remote"
build-args: |
VFB_TREE_PDB_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_TREE_PDB_SERVER }}
SOLR_SERVER_ARG=${{ steps.remote-servers.outputs.SOLR_SERVER }}
VFB_R_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_R_SERVER }}
VFB_OWL_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_OWL_SERVER }}
VFB_PDB_SERVER_ARG=${{ steps.remote-servers.outputs.VFB_PDB_SERVER }}
build_type=${{ steps.remote-servers.outputs.BUILD_TYPE }}
targetBranch=${{ steps.branch.outputs.value }}
originBranch=${{ steps.branch.outputs.value }}
defaultBranch=development
finalBuild=false

- name: Image digest
run: |
echo "local:${{ steps.docker_build_local.outputs.digest }}"
echo "remote:${{ steps.docker_build_remote.outputs.digest }}"

- name: Install Puppeteer
run: npm install jest@24.8.0 jest-image-snapshot@4.1.0 puppeteer@1.17.0 jest-puppeteer@4.3.0 @babel/preset-env@7.4.5 url-join@4.0.0 @babel/core@7.4.5
- name: Start VFB server
run: docker run -t -dit --name=testServer -p 8080:8080 "virtualflybrain/geppetto-vfb:${{ steps.branch.outputs.value }}-remote";
- name: Wait for VFB server to spin up
run: |
export LANDING_PAGE="http://localhost:8080/org.geppetto.frontend/geppetto"
Test () { export http_status=$(curl -s -i $LANDING_PAGE | grep HTTP/1.1 | awk {'print $2'}); echo "Returned status \"$http_status\""; if [ "$http_status" != "200" ]; then echo "Waiting for docker to finish building..."; iterations=$((iterations+1)); if [ "$iterations" != "100" ]; then sleep 1; Test; fi; else echo "$(date) - connected successfully"; fi; }
Test;
- name: Test batch 1
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch1/.*js'
- name: Test batch 2
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch2/.*js'
- name: Test batch 3
run: npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/batch3/.*js'
- name: Test under review
continue-on-error: true
run: |
if [ "${GITHUB_REF##*/}" == debug ] || [ "${GITHUB_REF##*/}" == pipeline2 ] || [ "${GITHUB_REF##*/}" == vfb_geppetto_application ] || [ "${GITHUB_REF##*/}" == development ] || [[ "${GITHUB_REF##*/}" =~ ^(fix|feature).* ]] ; then
npm test -- --verbose --colors --forceExit --testPathPattern='geppetto-vfb/tests/jest/vfb/review/.*js';
fi
- name: Stop VFB server
run: docker stop testServer
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/VirtualFlyBrain/geppetto-vfb.svg?branch=master)](https://travis-ci.org/VirtualFlyBrain/geppetto-vfb)[![Docker Hub](https://www.shippable.com/assets/images/logos/docker-hub.jpg)](https://hub.docker.com/r/virtualflybrain/geppetto-vfb/)
[![Build Status](https://github.com/VirtualFlyBrain/geppetto-vfb/workflows/CI/badge.svg)](https://github.com/Robbie1977/geppetto-vfb/actions?query=workflow%3ACI)[![Docker Hub](https://www.shippable.com/assets/images/logos/docker-hub.jpg)](https://hub.docker.com/r/virtualflybrain/geppetto-vfb/)

# geppetto-vfb
Virtual Fly Brain project customised Geppetto build
Expand Down