fix: windows test exec #7
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
name: Test | |
on: | |
push: | |
paths: | |
- '.github/workflows/test.yml' | |
- 'src/**/*' | |
- 'Cargo.toml' | |
pull_request: | |
paths: | |
- '.github/workflows/test.yml' | |
- 'src/**/*' | |
- 'Cargo.toml' | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [windows-latest, ubuntu-latest, macos-latest] | |
# Setup | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
./target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
# Build the library | |
- name: Build | |
run: cargo build --release | |
# Build test/test.c | |
- name: Build test | |
run: gcc -o test/testlib test/test.c -L target/release -lfile_metadata | |
# Run test/test.c | |
- name: Run | |
if: matrix.platform != 'windows-latest' | |
run: ./test/testlib | |
- name: Run | |
if: matrix.platform == 'windows-latest' | |
run: test\testlib |