Update CI

This commit is contained in:
cyqsimon
2023-08-25 11:33:02 +08:00
parent 7eaee4e6ba
commit ff044d42e2
2 changed files with 13 additions and 87 deletions

View File

@@ -13,23 +13,11 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- stable
- macos
- win-msvc
include:
- build: stable
os: ubuntu-18.04
rust: stable
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-2019
rust: stable
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [stable, nightly]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
@@ -51,31 +39,31 @@ jobs:
# This is useful for debugging problems when the expected build artifacts
# (like shell completions and man pages) aren't generated.
- name: Show build.rs stderr
if: matrix.os == 'windows-2019'
if: matrix.os == 'windows-latest'
shell: bash
run: |
set +x
stderr="$(find "./target/debug" -name stderr -print0 | xargs -0 ls -t | head -n1)"
if [ -s "$stderr" ]; then
echo "===== $stderr ===== "
cat "$stderr"
mapfile -d '' -t STDERR_FILES < <(find "./target/debug" -name stderr -print0 | grep -z bandwhich)
for FILE in "${STDERR_FILES[@]}"; do
echo "===== $FILE ===== "
cat "$FILE"
echo "====="
fi
done
set -x
- name: Run tests
run: cargo test --verbose
- name: Upload unix binary
if: matrix.os != 'windows-2019'
uses: actions/upload-artifact@v1
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.rust }}
path: target/debug/bandwhich
- name: Upload windows binary
if: matrix.os == 'windows-2019'
uses: actions/upload-artifact@v2
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.rust }}
path: |

View File

@@ -1,62 +0,0 @@
name: nightly
on:
pull_request:
push:
branches:
- main
- actions
jobs:
test:
name: test
env:
# Emit backtraces on panics.
RUST_BACKTRACE: 1
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- ubuntu
- macos
- win-msvc
include:
- build: ubuntu
os: ubuntu-18.04
rust: nightly
- build: macos
os: macos-latest
rust: nightly
- build: win-msvc
os: windows-2019
rust: nightly
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Build
run: cargo build --verbose
# This is useful for debugging problems when the expected build artifacts
# (like shell completions and man pages) aren't generated.
- name: Show build.rs stderr
if: matrix.os == 'windows-2019'
shell: bash
run: |
set +x
stderr="$(find "./target/debug" -name stderr -print0 | xargs -0 ls -t | head -n1)"
if [ -s "$stderr" ]; then
echo "===== $stderr ===== "
cat "$stderr"
echo "====="
fi
set -x
- name: Run tests
run: cargo test --verbose