#172 caching in main pipeline

This commit is contained in:
neil 2023-01-25 17:32:54 +08:00
parent b4418eaa28
commit b89ba8b8de

View file

@ -36,6 +36,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
persist-credentials: false persist-credentials: false
- name: cache gui linux
uses: actions/cache@v3
with:
key: linux+x86-64-20-pnpm-cargo-main
path: |
./pnpm
./target
- name: build tauri for Linux - name: build tauri for Linux
if: startsWith(matrix.platform.name, 'linux') if: startsWith(matrix.platform.name, 'linux')
uses: docker://getneil/tea-builder:latest uses: docker://getneil/tea-builder:latest
@ -59,11 +66,22 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
if: startsWith(matrix.platform.name, 'darwin') if: startsWith(matrix.platform.name, 'darwin')
- name: cache gui build
# TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read
# but its ok to ignore, its still the fastest builder
# NOTE: enabling cache in the self hosted runner slows down the pipeline by 4m because post-cache builder error ^
if: startsWith(matrix.platform.name, 'linux') || matrix.platform.name == 'darwin+x86-64'
uses: actions/cache@v3
with:
key: ${{matrix.platform.name}}-pnpm-cargo-main
path: |
./pnpm
./target
- name: build tauri for MacOS - name: build tauri for MacOS
if: startsWith(matrix.platform.name, 'darwin') if: startsWith(matrix.platform.name, 'darwin')
run: tea -ES xc build run: tea -ES xc build
env: env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }} ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
@ -73,9 +91,9 @@ jobs:
- name: build tauri for Linux - name: build tauri for Linux
if: startsWith(matrix.platform.name, 'linux') if: startsWith(matrix.platform.name, 'linux')
# TODO: https://tauri.app/v1/guides/distribution/sign-linux # TODO: https://tauri.app/v1/guides/distribution/sign-linux
uses: docker://getneil/tea-builder:latest uses: ./devops/linux-builder
- run: tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle . - run: tar -czvf artifacts.tgz -C ./target/release/bundle .
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3