diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3613d75..c8fd6af9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,17 @@ jobs: # Build and test Multinet server. - run: pip install pipenv - - run: pipenv install --dev --deploy + + - uses: actions/cache@v1 + id: multinet-cache + with: + path: /home/runner/.local/share/virtualenvs/ + key: ${{ runner.os }}-${{ hashFiles('/home/runner/work/multinet/multinet/Pipfile.lock') }}-pipenv-cache-1 + + - name: Install pipenv packages + if: steps.multinet-cache.outputs.cache-hit != 'true' + run: pipenv install --dev --deploy + - run: pipenv run lint - run: pipenv run format - run: pipenv run typecheck @@ -35,7 +45,17 @@ jobs: - uses: actions/setup-node@v1 with: node-version: '10.x' - - run: cd client && yarn install + + - uses: actions/cache@v1 + id: client-cache + with: + path: /home/runner/work/multinet/multinet/client/node_modules + key: ${{ runner.os }}-${{ hashFiles('/home/runner/work/multinet/multinet/client/yarn.lock') }}-client-cache + + - name: Install yarn packages + if: steps.client-cache.outputs.cache-hit != 'true' + run: cd client && yarn install + - run: cd client && yarn lint - run: cd client && yarn lint:test - run: pipenv run test-server-up @@ -44,7 +64,16 @@ jobs: - run: cd client && yarn build # Build and test Multinet client library. - - run: cd multinetjs && yarn install + - uses: actions/cache@v1 + id: multinetjs-cache + with: + path: /home/runner/work/multinet/multinet/multinetjs/node_modules + key: ${{ runner.os }}-${{ hashFiles('/home/runner/work/multinet/multinet/multinetjs/yarn.lock') }}-multinetjs-cache + + - name: Install yarn packages + if: steps.multinetjs-cache.outputs.cache-hit != 'true' + run: cd multinetjs && yarn install + - run: cd multinetjs && yarn build - run: cd multinetjs && yarn lint - run: cd multinetjs && yarn test