From c2f9e9987feddaaf2a320f808b02c9da87de659a Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Wed, 19 Oct 2022 16:18:54 -0700 Subject: [PATCH 1/2] ci: split macos from linux builds macos builds continue to be flakey in ci for debug builds. In order to make ci less flakey, this change splits linux and macos builds and drops debug mode for macos builds. --- .github/workflows/cargo.yml | 46 +++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 8118fb909..cd77abbc0 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -9,10 +9,10 @@ env: RUST_BACKTRACE: full jobs: - build: + build-linux: strategy: matrix: - os: [ ubuntu-latest, macos-12 ] + os: [ ubuntu-latest ] profile: [ release, debug ] name: build-${{ matrix.os }}-${{ matrix.profile }} runs-on: ${{ matrix.os }} @@ -51,6 +51,48 @@ jobs: command: test args: ${{ env.CARGO_FLAGS }} --workspace --all-features --doc -- --test-threads 16 + build-macos: + strategy: + matrix: + os: [ macos-12 ] + profile: [ release ] + name: build-${{ matrix.os }}-${{ matrix.profile }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Update cargo flags + if: ${{ matrix.profile == 'release' }} + run: echo 'CARGO_FLAGS=--release' >> $GITHUB_ENV + shell: bash + - name: Update cargo flags + if: ${{ matrix.profile == 'debug' }} + run: echo 'CARGO_FLAGS=' >> $GITHUB_ENV + shell: bash + + - uses: Swatinem/rust-cache@v1 + with: + key: ${{ matrix.profile }} + - uses: actions-rs/cargo@v1 + name: build + with: + command: test + args: ${{ env.CARGO_FLAGS }} --workspace --all-features --tests --lib --bins --examples --no-run + - uses: actions-rs/cargo@v1 + name: test + with: + command: test + args: ${{ env.CARGO_FLAGS }} --workspace --all-features --tests --lib --bins --examples + - uses: actions-rs/cargo@v1 + if: ${{ matrix.profile == 'debug' }} + name: doctests + with: + command: test + args: ${{ env.CARGO_FLAGS }} --workspace --all-features --doc -- --test-threads 16 + bench-check: strategy: matrix: From be5bf498c37a423217441cad19c11b0b6849373f Mon Sep 17 00:00:00 2001 From: Brian Martin Date: Wed, 19 Oct 2022 16:25:46 -0700 Subject: [PATCH 2/2] better way to do that --- .github/workflows/cargo.yml | 49 ++++--------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index cd77abbc0..d5271ddca 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -9,53 +9,14 @@ env: RUST_BACKTRACE: full jobs: - build-linux: + build: strategy: matrix: - os: [ ubuntu-latest ] + os: [ ubuntu-latest, macos-12 ] profile: [ release, debug ] - name: build-${{ matrix.os }}-${{ matrix.profile }} - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: Update cargo flags - if: ${{ matrix.profile == 'release' }} - run: echo 'CARGO_FLAGS=--release' >> $GITHUB_ENV - shell: bash - - name: Update cargo flags - if: ${{ matrix.profile == 'debug' }} - run: echo 'CARGO_FLAGS=' >> $GITHUB_ENV - shell: bash - - - uses: Swatinem/rust-cache@v1 - with: - key: ${{ matrix.profile }} - - uses: actions-rs/cargo@v1 - name: build - with: - command: test - args: ${{ env.CARGO_FLAGS }} --workspace --all-features --tests --lib --bins --examples --no-run - - uses: actions-rs/cargo@v1 - name: test - with: - command: test - args: ${{ env.CARGO_FLAGS }} --workspace --all-features --tests --lib --bins --examples - - uses: actions-rs/cargo@v1 - if: ${{ matrix.profile == 'debug' }} - name: doctests - with: - command: test - args: ${{ env.CARGO_FLAGS }} --workspace --all-features --doc -- --test-threads 16 - - build-macos: - strategy: - matrix: - os: [ macos-12 ] - profile: [ release ] + exclude: + - os: macos-12 + profile: debug name: build-${{ matrix.os }}-${{ matrix.profile }} runs-on: ${{ matrix.os }} steps: