From 49751908005fca8415aa9b3a981b95bda58004ff Mon Sep 17 00:00:00 2001 From: = Date: Tue, 16 Feb 2021 16:32:51 +0100 Subject: [PATCH] Change run order, cache node modules, checkout repo --- .github/workflows/tests.yml | 46 ++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a67f4bd7..c4575114 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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/setup-node@v2.1.0 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