on: [push, pull_request] name: build-and-test jobs: ubuntu: name: Ubuntu 18.04 runs-on: ubuntu-18.04 strategy: matrix: rust: - stable steps: - name: Checkout sources uses: actions/checkout@v2 - name: Install toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable target: x86_64-unknown-linux-musl override: true - name: Install dependencies for musl libc run: | sudo apt-get update sudo apt-get install musl-tools - name: Run cargo build uses: actions-rs/cargo@v1 with: command: build args: --release --target x86_64-unknown-linux-musl - name: Run cargo test uses: actions-rs/cargo@v1 with: command: test - name: Strip binary run: strip target/x86_64-unknown-linux-musl/release/ouch - name: Upload binary uses: actions/upload-artifact@v2 with: name: 'ouch-linux-musl' path: target/x86_64-unknown-linux-musl/release/ouch macos: name: macOS runs-on: macos-latest strategy: matrix: rust: - stable steps: - name: Checkout sources uses: actions/checkout@v2 - name: Install toolchain uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} override: true - name: Run cargo build uses: actions-rs/cargo@v1 with: command: build args: --release - name: Run cargo test uses: actions-rs/cargo@v1 with: command: test - name: Strip binary run: strip target/release/ouch - name: Upload binary uses: actions/upload-artifact@v2 with: name: 'ouch-macOS' path: target/release/ouch windows: name: Windows Server runs-on: windows-2019 strategy: matrix: rust: - stable steps: - name: Checkout sources uses: actions/checkout@v2 - name: Install toolchain uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust }} override: true - name: Run cargo build uses: actions-rs/cargo@v1 with: command: build args: --release - name: Run cargo test uses: actions-rs/cargo@v1 with: command: test - name: Upload binary uses: actions/upload-artifact@v2 with: name: 'ouch-windows' path: target\release\ouch.exe