name: Build on: pull_request: push: paths: - ".github/workflows/build.yml" - "**/Cargo.toml" - "**/Cargo.lock" - "**/src/*" jobs: build_and_test: name: Build & Test # Use a build matrix to run this job targeting all supported platforms runs-on: ubuntu-latest strategy: matrix: # All supported targets target: - x86_64-unknown-linux-musl - aarch64-unknown-linux-musl # All supported Rust channels rust_channel: - stable # Common build steps steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust_channel }} override: true - name: Install cargo-deb uses: actions-rs/cargo@v1 with: command: install args: cargo-deb - name: Compile uses: actions-rs/cargo@v1 with: use-cross: true command: build args: --release --target ${{ matrix.target }} - name: Run Tests uses: actions-rs/cargo@v1 with: use-cross: true command: test args: --all --release --target ${{ matrix.target }} - name: Package DEB uses: actions-rs/cargo@v1 with: use-cross: false command: deb args: --target ${{ matrix.target }} --no-build - name: Upload DEB uses: actions/upload-artifact@v3 with: name: debian-packages path: target/${{ matrix.target }}/debian/*.deb