Skip to content

Commit

Permalink
Change run order, cache node modules, checkout repo
Browse files Browse the repository at this point in the history
  • Loading branch information
louilinn committed Feb 16, 2021
1 parent 490852e commit 4975190
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Run tests

on: [push, pull_request]
on: [push]

jobs:
tests:
runs-on: ubuntu-latest
env:
CIRCLES_DOCKER: $HOME/CirclesUBI/circles-docker
CIRCLES_CORE: $HOME/CirclesUBI/circles-core
CIRCLES_DOCKER: $/home/runner/work/circles-docker/circles-docker #$HOME/CirclesUBI/circles-docker
CIRCLES_CORE: $/home/runner/work/circles-core/circles-core
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
Expand All @@ -22,34 +23,51 @@ jobs:
- name: Disable postgres
run: sudo /etc/init.d/postgresql stop

- name: Check out repository code
uses: actions/checkout@v2

- name: Copy core configs
run: cp .env.example .env

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

- name: Setup docker repo
run: |
git clone https://github.com/CirclesUBI/circles-docker.git $CIRCLES_DOCKER
cd $CIRCLES_DOCKER
cp .env.example .env
- name: Container setup via docker-compose and migrate contracts
run: |
make build
make up
make contracts
make subgraph
$DOCKER_COMPOSE build
$DOCKER_COMPOSE up
$DOCKER_COMPOSE contracts
$DOCKER_COMPOSE subgraph
- name: Try starting failed services
run: make up

- name: Copy core configs
run: |
cd $CIRCLES_CORE
cp .env.example .env
- name: Switch to circles-core
run: cd $CIRCLES_CORE

- name: Setup Node
uses: actions/[email protected]
with:
node-version: '12.x'

- 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: Install dependencies
run: npm install

Expand Down

0 comments on commit 4975190

Please sign in to comment.