Skip to content

Commit

Permalink
perf(actions): made test-integration-chrome independent
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Nov 22, 2020
1 parent 842ea83 commit d489cfa
Showing 1 changed file with 31 additions and 40 deletions.
71 changes: 31 additions & 40 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 #1000 https://github.com/mstachniuk/ci-skip#use-cases
token: ${{ secrets.GH_TOKEN }}

- name: Gather CI metadata
uses: mstachniuk/ci-skip@v1
Expand Down Expand Up @@ -177,6 +176,36 @@ jobs:
- name: Test integration
run: npm run test-integration-externals

test-integration-chrome:
runs-on: ubuntu-latest
needs: metadata
if: needs.metadata.outputs.has-integration-chrome == 'true'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use node ${{ env.NODE_BASE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_BASE_VERSION }}

- name: Cache npm
uses: actions/cache@v2
id: cache-npm
with:
key: npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
path: ~/.npm
restore-keys: npm-${{ runner.os }}-

- name: Install CI dependencies
run: npm ci

- name: Build distributables
run: npm run build-dist

- name: Test integration
run: npm run test-integration-chrome

install-dependencies:
runs-on: ubuntu-latest
needs: metadata
Expand Down Expand Up @@ -243,44 +272,6 @@ jobs:
./dist
./build
test-integration-chrome:
runs-on: ubuntu-latest
needs: [metadata, build-dist]
if: needs.metadata.outputs.has-integration-chrome == 'true'
steps:
- name: Restore dependencies
uses: actions/cache@v2
id: restore-dependencies
with:
key: build-${{ github.sha }}
path: ./*

- name: Restore distributables
uses: actions/cache@v2
id: restore-dist
with:
key: build-${{ github.sha }}-dist
path: |
./dist
./build
- name: Determine puppeteer version
id: puppeteer
run: |
STR=$(node -e 'console.log(`puppeteer@${require("./package.json").devDependencies.puppeteer}`)')
echo "::set-output name=install-target::"$STR
- name: Reinstall ${{ steps.puppeteer.outputs.install-target }}
run: npm install ${{ steps.puppeteer.outputs.install-target }}

- name: Use node ${{ env.NODE_BASE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_BASE_VERSION }}

- name: Test integration
run: npm run test-integration-chrome

test-integration-webpack:
runs-on: ubuntu-latest
needs: [metadata, build-dist]
Expand Down Expand Up @@ -466,6 +457,6 @@ jobs:

- name: Perform semantic release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

0 comments on commit d489cfa

Please sign in to comment.