CI: Try creating build id
This commit is contained in:
parent
eaf4dbd261
commit
581ac5e3ea
36
.github/workflows/client.yml
vendored
36
.github/workflows/client.yml
vendored
|
|
@ -16,7 +16,28 @@ defaults:
|
||||||
working-directory: app/client
|
working-directory: app/client
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build_id:
|
||||||
|
steps:
|
||||||
|
- name: 'Set build id'
|
||||||
|
id: build_id
|
||||||
|
# add a step output `steps.build_id.outputs.id` as the unique id
|
||||||
|
run: echo "::set-output name=id::$(date +%s)"
|
||||||
|
- name: 'Cache .build-id'
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
# store the build id to github cache
|
||||||
|
path: ${{ github.workspace }}/.build-id
|
||||||
|
# use the build id to generate a completly unique cache
|
||||||
|
key: ${{ runner.os }}-build-id-${{ github.head_ref }}-${{ github.sha }}-${{ steps.build_id.outputs.id }}
|
||||||
|
- name: 'Save build id'
|
||||||
|
# store the build id to a folder that we can later cache.
|
||||||
|
run: |
|
||||||
|
mkdir -p .build-id
|
||||||
|
echo $BUILD_ID > .build-id/id
|
||||||
|
env:
|
||||||
|
BUILD_ID: ${{ steps.build_id.outputs.id }}
|
||||||
build:
|
build:
|
||||||
|
needs: build_id
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
|
|
@ -119,6 +140,21 @@ jobs:
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# restore the build id
|
||||||
|
- name: 'Cache .build-id'
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/.build-id
|
||||||
|
key: ${{ runner.os }}-build-id-${{ github.head_ref }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-id-${{ github.head_ref }}-${{ github.sha }}
|
||||||
|
# set the build id from the restored cache
|
||||||
|
- name: 'Set build id'
|
||||||
|
id: build_id
|
||||||
|
run: echo "::set-output name=id::$(cat .build-id/id)"
|
||||||
|
# because of "record" and "parallel" parameters
|
||||||
|
# these containers will load balance all found tests among themselves
|
||||||
|
|
||||||
- name: Use Node.js 10.16.3
|
- name: Use Node.js 10.16.3
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user