Summary: We sometimes see workflows fail due to network flakiness, almost always being Windows agents doing a `yarn install`. This change enables storing and reusing Yarn's package cache, and makes `yarn install` more permissive when it does hit the network. https://stackoverflow.com/questions/51508364/yarn-there-appears-to-be-trouble-with-your-network-connection-retrying Pull Request resolved: https://github.com/facebook/yoga/pull/1332 Test Plan: Workflows succeed, and we see cache being restored before yarn install step. Reviewed By: lunaleaps Differential Revision: D48967590 Pulled By: NickGerleman fbshipit-source-id: 55ce6f05496f014512e0153b6646a7ca0ab964d9
104 lines
2.0 KiB
YAML
104 lines
2.0 KiB
YAML
name: JavaScript
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
FORCE_COLOR: 3
|
|
|
|
jobs:
|
|
benchmark:
|
|
name: Benchmark [${{ matrix.os }}]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn benchmark
|
|
run: yarn benchmark
|
|
working-directory: javascript
|
|
|
|
build:
|
|
name: Build [${{ matrix.os }}]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn build
|
|
run: yarn build
|
|
working-directory: javascript
|
|
|
|
test:
|
|
name: Test [${{ matrix.os }}]
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn test
|
|
run: yarn test
|
|
working-directory: javascript
|
|
|
|
lint:
|
|
name: ESLint (All Packages)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn lint
|
|
run: yarn lint
|
|
|
|
typecheck:
|
|
name: Typecheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn tsc
|
|
run: yarn tsc
|
|
working-directory: javascript
|
|
|
|
pack:
|
|
name: Pack
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup
|
|
uses: ./.github/actions/setup-js
|
|
|
|
- name: yarn pack
|
|
run: yarn pack --filename yoga-layout.tar.gz
|
|
working-directory: javascript
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: npm-package
|
|
path: javascript/yoga-layout.tar.gz
|