希望能够运行以下类似的工作流,也许我只是在 GitHub Actions 中缺少简单的配置,但我不知道如何在使用 job.needs 指定哪些作业可以在其他成功完成后运行时共享工作区。
name: Node CI
on: [push]
env:
CI: true
jobs:
install:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: install node_modules
run: yarn install
lint:
runs-on: ubuntu-latest
needs: [install]
steps:
- name: eslint
run: yarn lint
build:
needs: [install]
runs-on: ubuntu-latest
steps:
- name: yarn build
run: yarn build
test:
needs: [install, build]
runs-on: ubuntu-latest
steps:
- name: jest
run: yarn test --coverage
我已经阅读了Github Actions共享工作区/工件的方法? 但我不想为每个步骤上传 node_modules
并下载。
actions/cache
!谢谢。 - JaKXz