FAT mkdsk, FAT tests #35
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: Rust | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
env: | |
CARGO_TERM_COLOR: always | |
defaults: | |
run: | |
# necessary for windows | |
shell: bash | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
./target | |
key: test-cargo-registry | |
- name: Run tests | |
run: cargo test --verbose | |
build: | |
strategy: | |
matrix: | |
include: | |
- TARGET: x86_64-unknown-linux-musl | |
OS: ubuntu-latest | |
- TARGET: x86_64-apple-darwin | |
OS: macos-latest | |
- TARGET: aarch64-apple-darwin | |
OS: macos-latest | |
- TARGET: x86_64-pc-windows-msvc | |
OS: windows-latest | |
needs: test | |
runs-on: ${{ matrix.OS }} | |
env: | |
NAME: a2kit | |
TARGET: ${{ matrix.TARGET }} | |
OS: ${{ matrix.OS }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install musl GCC wrapper | |
run: | | |
if [[ $OS =~ ^ubuntu.*$ ]]; then | |
sudo apt install musl-tools | |
fi | |
- name: Cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
./target | |
key: build-cargo-registry-${{matrix.TARGET}} | |
- name: Install rust target | |
run: rustup target add $TARGET | |
- name: Run build | |
run: cargo build --release --verbose --target $TARGET | |
- name: Compress | |
run: | | |
mkdir -p ./artifacts | |
# windows is the only OS using a different convention for executable file name | |
if [[ $OS =~ ^windows.*$ ]]; then | |
EXEC=$NAME.exe | |
else | |
EXEC=$NAME | |
fi | |
if [[ $GITHUB_REF_TYPE =~ ^tag$ ]]; then | |
TAG=$GITHUB_REF_NAME | |
else | |
TAG=$GITHUB_SHA | |
fi | |
mv ./target/$TARGET/release/$EXEC ./$EXEC | |
tar -czf ./artifacts/$NAME-$TARGET-$TAG.tar.gz $EXEC | |
- name: Archive artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: result | |
path: ./artifacts |