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

Migrate Travis CI to Github Actions #67

Merged
merged 45 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9f2268a
Migrate Travis CI to Github Actions
louilinn Feb 11, 2021
2e1bf70
Syntax fix workflow tests
louilinn Feb 11, 2021
490852e
Fix problems with env variables and more
louilinn Feb 16, 2021
ccb6768
Change run order, cache node modules, checkout repo
louilinn Feb 16, 2021
a0f9475
Change github actions to run containers detatteched instead with flag -d
louilinn Feb 23, 2021
9e4ce52
Checkout contracts and subgraph repos in github actions before tests
louilinn Feb 26, 2021
9b61b50
Checkout contracts with correct branch master in github actions
louilinn Feb 26, 2021
9bb82de
Correct commands
louilinn Feb 26, 2021
4276afe
Add clearer steps in github actions for tests
louilinn Feb 26, 2021
6b2a2d6
Change order of steps in github workflow
louilinn Mar 2, 2021
dbb491c
Remove postgresql from tests GHAction
llunaCreixent Mar 5, 2021
7e00db2
Check postgresql status in tests GHAction
llunaCreixent Mar 5, 2021
dfcc2fa
Use the node version in .nvmrc for GH Actions
llunaCreixent Mar 5, 2021
11c6cd9
Remove postgresql from tests GHAction, again
llunaCreixent Mar 5, 2021
db29728
Add full path to .env files
llunaCreixent Mar 8, 2021
f43c15f
Remove full path to .env files
llunaCreixent Mar 8, 2021
b7e1208
Set up path for circles-docker actions/checkout in tests workflow
llunaCreixent Mar 8, 2021
ad5fe19
Test working directories in tests workflow
llunaCreixent Mar 8, 2021
c109a14
Remove path from actions/checkout in tests workflow
llunaCreixent Mar 8, 2021
3d0e63e
Try setting path to actions/checkout
llunaCreixent Mar 8, 2021
43afb40
Try parallell paths to repos under github workspace
louilinn Mar 9, 2021
b893c5b
Add working directory to step - try
louilinn Mar 9, 2021
220c2f7
Print working dir before copying config in core
louilinn Mar 9, 2021
cfcb750
Print directory before copying core config
louilinn Mar 9, 2021
cb91d1b
Print circles-core dir
louilinn Mar 9, 2021
963e54f
Print circles-core dir correctly
louilinn Mar 9, 2021
bb921f9
Change working dir to only circles-core
louilinn Mar 9, 2021
1c3fffe
Add working directory to circles docker
louilinn Mar 9, 2021
92b9012
Add working dir for nvmrc
louilinn Mar 9, 2021
a70c46a
Add working directory to all steps where relevant
louilinn Mar 9, 2021
1f75c66
Add IP address in etc hosts and remove some comments
louilinn Mar 9, 2021
cd68ba1
Setup tmate session for debugging
louilinn Mar 22, 2021
b495cde
Chage tmate timeout to 20 min
louilinn Mar 23, 2021
459abfa
Remove without sudo
louilinn Mar 23, 2021
d366b73
Remove timeout
louilinn Mar 23, 2021
c572bf9
Update tests.yml
louilinn Mar 25, 2021
d2ac7ba
Add timeout tmate 80 min
louilinn Mar 25, 2021
a161f3e
Change docker commands
louilinn Mar 25, 2021
5391777
Change to correct docker commands
louilinn Mar 29, 2021
f29e71e
Update tests.yml
louilinn Mar 29, 2021
f650759
Remove tmate session
adzialocha Apr 7, 2021
a85e384
Merge branch 'main' into travis-migration-to-github-actions
llunaCreixent Apr 8, 2021
3bca8a6
Merge branch 'main' into travis-migration-to-github-actions
llunaCreixent Apr 8, 2021
eaadaec
Try running tests in series
adzialocha Apr 8, 2021
f36b49b
Remove travis file
louilinn Apr 8, 2021
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
85 changes: 85 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Run tests

on: [push]

jobs:
tests:
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
DOCKER_COMPOSE: docker-compose -f docker-compose.yml -f docker-compose.frontend.yml -p circles

steps:
- name: Add hosts to /etc/hosts
run: |
sudo echo "127.0.1.1 api.circles.local" | sudo tee -a /etc/hosts
sudo echo "127.0.1.1 graph.circles.local" | sudo tee -a /etc/hosts
sudo echo "127.0.1.1 relay.circles.local" | sudo tee -a /etc/hosts

- name: Check out circles-core repository code
uses: actions/checkout@v2
with:
path: circles-core

- name: Copy core configs
working-directory: circles-core
run: cp .env.example .env

- name: Read node version from .nvmrc
working-directory: circles-core
id: nvmrc
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-

- name: Get circles-docker repository and copy configs
uses: actions/checkout@v2
with:
repository: CirclesUBI/circles-docker.git
ref: main
path: circles-docker

- name: Setup docker repo
working-directory: circles-docker
run: cp .env.example .env

- name: Container setup via docker-compose
working-directory: circles-docker
run: docker-compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build

- name: Download and migrate contracts
working-directory: circles-docker
run: ./scripts/migrate-contracts.sh

- name: Create and deploy subgraph
working-directory: circles-docker
run: ./scripts/deploy-subgraph.sh

- name: Try starting failed services
working-directory: circles-docker
run: docker-compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build

- name: Install dependencies
working-directory: circles-core
run: npm install

- name: Run tests
working-directory: circles-core
run: npm run test

- name: Build
working-directory: circles-core
run: npm run test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.21
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"docs:serve": "documentation serve --watch ./src/**",
"docs:lint": "documentation lint ./src/**",
"lint": "eslint --ignore-path .gitignore --ignore-pattern lib .",
"test": "jest",
"test": "jest --runInBand",
"test:watch": "npm run test -- --watch"
},
"devDependencies": {
Expand Down