-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simplify build * Do install * Use npx * Build and setup * Remove version * Cache dependencies * Setup node * Try to fix build test
- Loading branch information
Showing
3 changed files
with
28 additions
and
43 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 |
---|---|---|
|
@@ -10,42 +10,32 @@ on: | |
- main | ||
# Launches build when release is published | ||
release: | ||
types: [ published ] | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build Package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Remove broken apt repos [Ubuntu] | ||
if: ${{ matrix.os }} == 'ubuntu-latest' | ||
run: | | ||
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
node-version: 14 | ||
|
||
- run: | | ||
# Due to some dependencies yarn may randomly throw an error about invalid cache | ||
# This approach is taken from https://github.com/yarnpkg/yarn/issues/7212#issuecomment-506155894 to fix the issue | ||
# Another approach is to install with flag --network-concurrency 1, but this will make the installation pretty slow (default value is 8) | ||
mkdir .yarncache | ||
yarn install --cache-folder ./.yarncache --frozen-lockfile | ||
rm -rf .yarncache | ||
yarn cache clean | ||
- name: Cache Yarn dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build app | ||
run: yarn build |
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 |
---|---|---|
@@ -1,33 +1,28 @@ | ||
name: Unit tests | ||
on: [ push, pull_request ] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14 | ||
|
||
- name: Yarn cache | ||
- name: Cache Yarn dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | ||
path: | | ||
node_modules | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Yarn install | ||
run: | | ||
mkdir .yarncache | ||
yarn install --cache-folder ./.yarncache --frozen-lockfile | ||
rm -rf .yarncache | ||
yarn cache clean | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run tests | ||
run: yarn test |
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