This action will help you to persist your workspace from job to job on your workflow! With that you will be able to split your jobs and parallelize them without the need to re-do that basic steps needed for all the jobs.
This action use actions/upload-artifact and actions/download-artifact under the hood.
name: My CI
on:
pull_request:
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist
name: My CI
on:
pull_request:
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist
build:
needs: [init]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: chatfood/gh-action-persist-workspace@master
with:
action: retrieve
- name: Build the project
run: npm run build
name: My CI
on:
pull_request:
jobs:
init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm install
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: persist
test:
needs: [init]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: retrieve
- name: Run unit tests
run: npm run test
build:
needs: [init]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
- uses: bissolli/gh-action-persist-workspace@v2
with:
action: retrieve
- name: Build the project
run: npm run build
Input | Type | Default | Description |
---|---|---|---|
action | persist or retrieve |
persist |
Whether you would like to persist or retrieve the workspace. |
artifactName | string |
persisted-artifact | Name of the generated artifact |