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:
Thayne McCombs 2022-12-01 23:46:31 -07:00
parent df4e297cb8
commit 989b55f1b1
1 changed files with 43 additions and 4 deletions

View File

@ -54,9 +54,39 @@ jobs:
- name: Run tests - name: Run tests
run: cargo test --locked 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: build:
name: ${{ matrix.job.os }} (${{ matrix.job.target }}) name: ${{ matrix.job.os }} (${{ matrix.job.target }})
runs-on: ${{ matrix.job.os }} runs-on: ${{ matrix.job.os }}
needs: completions
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -179,10 +209,19 @@ jobs:
- name: Run tests - name: Run tests
run: ${{ env.CARGO_CMD }} test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}} run: ${{ env.CARGO_CMD }} test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
- name: Generate completions - name: Download Unix Completions
id: completions if: "!startsWith(matrix.job.os, 'windows')"
shell: bash uses: actions/download-artifact@v3
run: make completions 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 - name: Create tarball
id: package id: package