Skip to content

fix: test file

fix: test file #9

Workflow file for this run

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 == 'macos-latest'
run: ./test/testlib
- name: Run
if: matrix.platform == 'ubuntu-latest'
run: LD_LIBRARY_PATH=target/release ./test/testlib
- name: Run
if: matrix.platform == 'windows-latest'
run: move target\release\file_metadata.dll file_metadata.dll && test\testlib.exe