Flow and Lint and TSC #2901
Workflow file for this run
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
name: Flow and Lint and TSC | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [ opened, ready_for_review ] | |
pull_request_review: | |
types: [ submitted ] | |
jobs: | |
flow-and-lint: | |
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request && github.event.pull_request.draft == false) || (github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/release-check'))) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Read .nvmrc | |
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | |
id: nvm | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '${{ steps.nvm.outputs.NVMRC }}' | |
- name: Cache node modules | |
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-yoroi-extension-node-modules | |
with: | |
# https://github.com/actions/cache/blob/main/examples.md#node---npm | |
# It is recommended to cache the NPM cache (~/.npm) instead of node_modules. | |
# But we put node version into the cache key and cache node_modules. | |
path: packages/yoroi-extension/node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-extension/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: npm install | |
run: | | |
. install-all.sh | |
- name: flow | |
run: | | |
npm run flow | |
- name: lint | |
run: | | |
npm run eslint | |
- name: tsc | |
run: | | |
npm run tsc |