Update crates #631
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: CI | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install linux dependencies | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev | |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: ${{ runner.os }}-cargo-check-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} | |
- name: Cargo check | |
shell: bash | |
run: | | |
cargo check --all-features | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install linux dependencies | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev | |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: ${{ runner.os }}-cargo-test-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} | |
- name: Cargo test | |
shell: bash | |
run: | | |
cargo test --all-features | |
build: | |
name: Build (${{ matrix.osname }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-latest | |
osname: "osx-x64" | |
- os: ubuntu-latest | |
osname: "linux-x64" | |
- os: windows-latest | |
osname: "win-x64" | |
env: | |
ZIP_NAME: ${{ github.event.repository.name }}-ci-${{ github.sha }}-${{ matrix.osname }} | |
BIN_PATH: ./target/release | |
OUTPUT_PATH: ./build | |
steps: | |
- name: Install linux dependencies | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev | |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/ | |
target/ | |
key: ${{ matrix.osname }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml', './Cargo.lock') }} | |
- name: Cargo build | |
shell: bash | |
run: | | |
cargo build --release --bins | |
- name: Create output directory and copy licenses | |
shell: bash | |
run: | | |
mkdir -p $OUTPUT_PATH | |
cp -f ./LICENSE $OUTPUT_PATH/LICENSE | |
cp -f ./README.md $OUTPUT_PATH/README.md | |
- name: Copy executables to output directory | |
shell: bash | |
run: | | |
for exe in $(find $BIN_PATH -maxdepth 1 -type f ${{ matrix.os == 'macos-latest' && '-perm +0111' || '-executable' }} -print); do | |
cp -f $exe $OUTPUT_PATH/$(basename $exe) | |
done | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ZIP_NAME }} | |
path: ${{ env.OUTPUT_PATH }}/* |