diff --git a/.github/workflows/Build_and_test.yml b/.github/workflows/Build_and_test.yml new file mode 100644 index 0000000..6ae2825 --- /dev/null +++ b/.github/workflows/Build_and_test.yml @@ -0,0 +1,64 @@ +name: Build and test workflow + +on: + push: + branches: + - master + pull_request: + +env: + CARGO_TERM_COLOR: always + LLVM-MINGW-TOOLCHAIN-NAME: llvm-mingw-20240619-ucrt-ubuntu-20.04-x86_64 + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, windows-latest, macos-latest, ubuntu-latest] # ubuntu latest is only used for building the windows aarch64 binary + include: + - os: ubuntu-20.04 + libacl: libacl1-dev + toolchain: stable + target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + libacl: "" # no libacl on ubuntu-latest for windows aarch64 + toolchain: nightly + target: aarch64-pc-windows-gnullvm + - os: windows-latest + libacl: "" + toolchain: nightly + target: x86_64-pc-windows-msvc + - os: macos-latest + libacl: "" + toolchain: stable + target: x86_64-apple-darwin + + steps: + - uses: actions/checkout@v2 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + components: clippy + default: true + + - name: Install acl-deps (Linux only) + if: matrix.os == 'ubuntu-20.04' + run: sudo apt-get install -y ${{ matrix.libacl }} + + - name: Install LLVM MinGW toolchain (Windows aarch64) + if: matrix.os == 'ubuntu-latest' + run: | + curl -L -o ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz https://github.com/mstorsjo/llvm-mingw/releases/download/20240619/${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz + tar -xf ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz + echo "$GITHUB_WORKSPACE/${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH + + - name: Build ${{ matrix.target }} + run: cargo clippy --verbose --all-features --target ${{ matrix.target }} + + - name: Run tests + if: matrix.os != 'ubuntu-latest' + run: cargo test --verbose --all-features --target ${{ matrix.target }} diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml deleted file mode 100644 index 8ac4d73..0000000 --- a/.github/workflows/build_and_test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build and test workflow - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - release: - types: [ created ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-20.04, windows-latest, macos-latest] - steps: - - uses: actions/checkout@v2 - - name: Install acl-deps - if: matrix.os == 'ubuntu-20.04' - run: sudo apt-get install acl-dev - - name: Set up Rust - if: matrix.os == 'windows-latest' - run: rustup toolchain install nightly && rustup default nightly && rustup component add clippy - - name: Build - run: cargo clippy --verbose --all-features - - name: Run tests - run: cargo test --verbose --all-features