mirror of https://github.com/sharkdp/fd.git
Attempt to speed up completion generation in CI
By only generating it once for unix and once for windows and passing it through outputs.
This commit is contained in:
parent
df4e297cb8
commit
989b55f1b1
|
@ -54,9 +54,39 @@ jobs:
|
|||
- name: Run tests
|
||||
run: cargo test --locked
|
||||
|
||||
completions:
|
||||
name: Generate shell completions
|
||||
runs-on: ${{ matrix.job.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
# Completions are different depending on the OS
|
||||
job:
|
||||
- { name: unix, os: ubuntu-20.04 }
|
||||
- { name: windows, os: windows-2019 }
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install rsut toolchain
|
||||
run: |
|
||||
rustup set profile minimal
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
- name: Generate completions
|
||||
# Use dev profile so it builds faster
|
||||
run: make completions PROFILE=dev
|
||||
- id: upload
|
||||
name: upload completions
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: completions-${{ matrix.job.name }}
|
||||
path: autocomplete
|
||||
retention-days: 7
|
||||
|
||||
build:
|
||||
name: ${{ matrix.job.os }} (${{ matrix.job.target }})
|
||||
runs-on: ${{ matrix.job.os }}
|
||||
needs: completions
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
@ -179,10 +209,19 @@ jobs:
|
|||
- name: Run tests
|
||||
run: ${{ env.CARGO_CMD }} test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
||||
|
||||
- name: Generate completions
|
||||
id: completions
|
||||
shell: bash
|
||||
run: make completions
|
||||
- name: Download Unix Completions
|
||||
if: "!startsWith(matrix.job.os, 'windows')"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: completions-unix
|
||||
path: autocomplete/
|
||||
|
||||
- name: Download Windows Completions
|
||||
if: "startsWith(matrix.job.os, 'windows')"
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: completions-windows
|
||||
path: autocomplete/
|
||||
|
||||
- name: Create tarball
|
||||
id: package
|
||||
|
|
Loading…
Reference in New Issue