diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61d34ebfc4..81adfeb76f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,13 +12,28 @@ on: jobs: lint: + name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions/setup-node@v1 + - name: Checkout + uses: actions/checkout@master + - name: Setup node + uses: actions/setup-node@v2-beta with: node-version: 12 - - run: npx panva/npm-install-retry + - name: Store node version variable + id: node + run: | + echo "::set-output name=version::$(node -v)" + - name: Cache node_modules + uses: actions/cache@v2 + id: node_modules + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }} + - name: Install dependencies + run: npx panva/npm-install-retry + if: ${{ steps.node_modules.outputs.cache-hit != 'true' }} - run: npm run lint - run: npm run lint-ts @@ -42,11 +57,25 @@ jobs: - windows-latest - macOS-latest steps: - - uses: actions/checkout@master - - uses: actions/setup-node@v1 + - name: Checkout + uses: actions/checkout@master + - name: Setup node + uses: actions/setup-node@v2-beta with: node-version: ${{ matrix.node-version }} - - run: npx panva/npm-install-retry + - name: Store node version variable + id: node + run: | + echo "::set-output name=version::$(node -v)" + - name: Cache node_modules + uses: actions/cache@v2 + id: node_modules + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }} + - name: Install dependencies + run: npx panva/npm-install-retry + if: ${{ steps.node_modules.outputs.cache-hit != 'true' }} - run: npm run coverage - env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -70,10 +99,24 @@ jobs: - windows-latest - macOS-latest steps: - - uses: actions/checkout@master - - uses: actions/setup-node@v1 + - name: Checkout + uses: actions/checkout@master + - name: Setup node + uses: actions/setup-node@v2-beta with: node-version: 12 + - name: Store node version variable + id: node + run: | + echo "::set-output name=version::$(node -v)" + - name: Cache node_modules + uses: actions/cache@v2 + id: node_modules + with: + path: node_modules + key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}-${{ steps.node.outputs.version }} + - name: Install dependencies + run: npx panva/npm-install-retry + if: ${{ steps.node_modules.outputs.cache-hit != 'true' }} - run: npm install --global xvfb-maybe electron@${{ matrix.electron-version }} - - run: npx panva/npm-install-retry - run: xvfb-maybe electron ./test/electron