-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: refactor GitHub Action jobs (#1875)
* build(ci): split up fast and slow tests into separate jobs * build(ci): replace glob with globby in test-globber.ts to split out integration tests better * build(ci): parallelize fast tests
- Loading branch information
Showing
5 changed files
with
284 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,61 @@ jobs: | |
env: | ||
DEPENDABOLT_SSH_DEPLOY_KEY: ${{ secrets.DEPENDABOLT_SSH_DEPLOY_KEY }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
test: | ||
fast-tests: | ||
runs-on: ${{ matrix.os }} | ||
needs: dependabolt | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macOS-latest, ubuntu-latest] | ||
node-installer: [npm, yarn] | ||
steps: | ||
- name: Fix git checkout line endings | ||
run: git config --global core.autocrlf input | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 10.x | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 10.x | ||
- name: Determine Yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- name: Cache Yarn | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install bolt | ||
shell: bash | ||
run: | | ||
case "$(uname -s)" in | ||
Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;; | ||
*) BOLT_VERSION=latest ;; | ||
esac | ||
npm install -g bolt@$BOLT_VERSION | ||
- name: Install | ||
run: bolt | ||
- name: Lint | ||
run: bolt lint | ||
- name: Build | ||
run: bolt build | ||
- name: Run tests | ||
run: bolt coverage:fast | ||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.lcov | ||
env_vars: CI_OS,TEST_TYPE | ||
env: | ||
CI_OS: ${{ matrix.os }} | ||
TEST_TYPE: fast | ||
|
||
slow-tests: | ||
runs-on: ${{ matrix.os }} | ||
needs: dependabolt | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macOS-latest, ubuntu-latest] | ||
steps: | ||
- name: Fix git checkout line endings | ||
run: git config --global core.autocrlf input | ||
|
@@ -69,10 +116,6 @@ jobs: | |
npm install -g bolt@$BOLT_VERSION | ||
- name: Install | ||
run: bolt | ||
- name: Lint | ||
run: bolt lint | ||
- name: Build | ||
run: bolt build | ||
- name: Test on Windows | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
|
@@ -83,26 +126,24 @@ jobs: | |
{ | ||
Write-Host "Unable to find light.exe in your PATH" | ||
} | ||
bolt coverage | ||
env: | ||
NODE_INSTALLER: ${{ matrix.node-installer }} | ||
bolt coverage:slow | ||
- name: Test on macOS/Linux | ||
if: matrix.os != 'windows-latest' | ||
run: bolt coverage | ||
run: bolt coverage:slow | ||
env: | ||
NODE_INSTALLER: ${{ matrix.node-installer }} | ||
DEBUG: electron-installer-snap:snapcraft | ||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ./coverage.lcov | ||
env_vars: CI_OS,NODE_INSTALLER | ||
env_vars: CI_OS,TEST_TYPE | ||
env: | ||
CI_OS: ${{ matrix.os }} | ||
NODE_INSTALLER: ${{ matrix.node-installer }} | ||
TEST_TYPE: slow | ||
|
||
# docs: | ||
# if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
# needs: test | ||
# needs: [fast-tests, slow-tests] | ||
# runs-on: [ubuntu-latest] | ||
# steps: | ||
# - uses: actions/checkout@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.