From 944f55940f3c6bcc42ec9dc18e5dbf04ad4009c4 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 10 Dec 2020 10:27:39 +0900 Subject: [PATCH] Attempt to merge test and cross --- .github/workflows/ci.yml | 45 +++++++++++++--------------------------- ci/cross.sh | 8 +++++++ 2 files changed, 22 insertions(+), 31 deletions(-) create mode 100755 ci/cross.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 451d09df4..9fac3b8f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,44 +34,27 @@ jobs: - crossbeam-queue - crossbeam-skiplist - crossbeam-utils - rust: - - 1.36.0 - - nightly - os: - - ubuntu-latest - - windows-latest + build: + - { rust: 1.36.0, os: ubuntu-latest } + - { rust: 1.36.0, os: windows-latest } + - { rust: nightly, os: ubuntu-latest } + - { rust: nightly, os: windows-latest } + - { rust: stable, os: ubuntu-latest, target: i686-unknown-linux-gnu } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - name: Install Rust # --no-self-update is necessary because the windows environment cannot self-update rustup.exe. - run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} + run: rustup update ${{ matrix.build.rust }} --no-self-update && rustup default ${{ matrix.build.rust }} - name: Test + if: matrix.build.target == '' run: ./ci/${{ matrix.crates }}.sh - - # Test crates on non x86_64 architectures. - cross: - strategy: - matrix: - crates: - - crossbeam - - crossbeam-channel - - crossbeam-deque - - crossbeam-epoch - - crossbeam-queue - - crossbeam-skiplist - - crossbeam-utils - target: - - i686-unknown-linux-gnu - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install Rust - run: rustup update stable && rustup default stable - - name: Install cross - run: cargo install cross - - name: Test - run: cross test --package ${{ matrix.crates }} --target ${{ matrix.target }} + - name: Cross + if: matrix.build.target != '' + run: ./ci/cross.sh + env: + CRATE: ${{ matrix.crates }} + TARGET: ${{ matrix.build.target }} # Check all feature combinations works properly. features: diff --git a/ci/cross.sh b/ci/cross.sh new file mode 100755 index 000000000..ef2ee1c2b --- /dev/null +++ b/ci/cross.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +cd "$(dirname "$0")"/.. +set -ex + +cargo install cross + +cross test --package "$CRATE" --target "$TARGET"