Skip to content
Snippets Groups Projects
Verified Commit 6d9bd0a1 authored by Geoffrey Arthaud's avatar Geoffrey Arthaud
Browse files

Corrected CI on github

parent 3d018a09
Branches
Tags
No related merge requests found
......@@ -10,88 +10,48 @@ jobs:
test:
name: test
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_DIR: ./target
# Emit backtraces on panics.
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
# We test on a pinned version of Rust, along with the moving
# targets of 'stable' and 'beta' for good measure.
- pinned
- stable
- beta
# Our release builds are generated by a nightly compiler to take
# advantage of the latest optimizations/compile time improvements. So
# we test all of them here. (We don't do mips releases, but test on
# mips for big-endian coverage.)
- nightly
- nightly-musl
- macos
- win-msvc
- win-gnu
include:
- build: pinned
os: ubuntu-18.04
os: ubuntu-20.04
rust: 1.52.1
- build: stable
os: ubuntu-18.04
os: ubuntu-20.04
rust: stable
- build: beta
os: ubuntu-18.04
os: ubuntu-20.04
rust: beta
- build: nightly
os: ubuntu-18.04
rust: nightly
- build: nightly-musl
os: ubuntu-18.04
os: ubuntu-20.04
rust: nightly
target: x86_64-unknown-linux-musl
- build: macos
os: macos-latest
rust: nightly
- build: win-msvc
os: windows-2019
rust: nightly
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-18.04'
run: |
ci/ubuntu-install-packages
- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
ci/macos-install-packages
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Use Cross
if: matrix.target != ''
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
- name: Build gitlab-project-doctor and all crates
run: ${{ env.CARGO }} build --verbose --workspace ${{ env.TARGET_FLAGS }}
run: cargo build --verbose
# This is useful for debugging problems when the expected build artifacts
# (like shell completions and man pages) aren't generated.
......@@ -99,7 +59,7 @@ jobs:
shell: bash
run: |
set +x
stderr="$(find "${{ env.TARGET_DIR }}/debug" -name stderr -print0 | xargs -0 ls -t | head -n1)"
stderr="$(find "target/debug" -name stderr -print0 | xargs -0 ls -t | head -n1)"
if [ -s "$stderr" ]; then
echo "===== $stderr ===== "
cat "$stderr"
......@@ -108,8 +68,7 @@ jobs:
set -x
- name: Run tests
if: matrix.target != ''
run: ${{ env.CARGO }} test --verbose --workspace ${{ env.TARGET_FLAGS }}
run: cargo test --verbose
rustfmt:
name: rustfmt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment