2020-12-15 05:16:10 +00:00
|
|
|
# Note, this is used in the badge URL!
|
|
|
|
name: test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master, dev]
|
2021-04-09 15:01:30 +00:00
|
|
|
paths:
|
|
|
|
[
|
|
|
|
"**.rs",
|
|
|
|
"Cargo.toml",
|
2021-05-08 20:41:19 +00:00
|
|
|
"Cargo.lock",
|
|
|
|
"rustfmt.toml",
|
|
|
|
".github/workflows/*",
|
2021-06-20 05:07:33 +00:00
|
|
|
"!*.md",
|
2021-06-18 22:20:27 +00:00
|
|
|
"!contrib/*",
|
|
|
|
"!docs/*",
|
|
|
|
"!LICENSE",
|
2021-06-20 05:07:33 +00:00
|
|
|
"!*.sh",
|
2021-04-09 15:01:30 +00:00
|
|
|
]
|
2020-12-15 05:16:10 +00:00
|
|
|
pull_request:
|
2021-04-09 15:01:30 +00:00
|
|
|
paths:
|
|
|
|
[
|
|
|
|
"**.rs",
|
|
|
|
"Cargo.toml",
|
2021-05-08 20:41:19 +00:00
|
|
|
"Cargo.lock",
|
|
|
|
"rustfmt.toml",
|
|
|
|
".github/workflows/*",
|
2021-06-20 05:07:33 +00:00
|
|
|
"!*.md",
|
2021-06-18 22:20:27 +00:00
|
|
|
"!contrib/*",
|
|
|
|
"!docs/*",
|
|
|
|
"!LICENSE",
|
2021-06-20 05:07:33 +00:00
|
|
|
"!*.sh",
|
2021-04-09 15:01:30 +00:00
|
|
|
]
|
|
|
|
schedule:
|
|
|
|
# Run CI every week
|
|
|
|
- cron: "00 01 * * 0"
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2020-12-15 05:16:10 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
fmt:
|
2021-04-09 15:01:30 +00:00
|
|
|
name: rustfmt
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-15 05:16:10 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-04-09 15:01:30 +00:00
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
2020-12-15 05:16:10 +00:00
|
|
|
override: true
|
2021-04-09 15:01:30 +00:00
|
|
|
components: rustfmt
|
|
|
|
- run: cargo fmt --all -- --check
|
2020-12-15 05:16:10 +00:00
|
|
|
|
2021-04-09 15:01:30 +00:00
|
|
|
test-linux:
|
2020-12-15 05:16:10 +00:00
|
|
|
needs: fmt
|
2021-04-09 15:01:30 +00:00
|
|
|
name: cargo +${{ matrix.toolchain }} build (${{ matrix.os }})
|
2020-12-15 05:16:10 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
toolchain:
|
2022-05-04 22:19:29 +00:00
|
|
|
- 1.53 # MSRV (Minimum supported rust version)
|
2020-12-15 05:16:10 +00:00
|
|
|
- stable
|
|
|
|
- beta
|
|
|
|
experimental: [false]
|
2021-04-09 15:01:30 +00:00
|
|
|
# Ignore failures in nightly
|
2020-12-15 05:16:10 +00:00
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
toolchain: nightly
|
|
|
|
experimental: true
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-04-09 15:01:30 +00:00
|
|
|
|
2020-12-15 05:16:10 +00:00
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
override: true
|
2021-04-09 15:01:30 +00:00
|
|
|
|
|
|
|
- name: Get Rustc version
|
|
|
|
id: get-rustc-version
|
|
|
|
run: echo "::set-output name=version::$(rustc -V)"
|
|
|
|
shell: bash
|
|
|
|
|
2021-01-31 01:55:47 +00:00
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry/index
|
|
|
|
~/.cargo/registry/cache
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
2021-05-08 20:41:19 +00:00
|
|
|
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
|
2021-04-09 15:01:30 +00:00
|
|
|
|
2020-12-15 05:16:10 +00:00
|
|
|
- name: Install developer package dependencies
|
2021-04-09 15:01:30 +00:00
|
|
|
run: sudo apt-get update && sudo apt-get install libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev gstreamer1.0-dev libgstreamer-plugins-base1.0-dev libavahi-compat-libdnssd-dev
|
|
|
|
|
|
|
|
- run: cargo build --workspace --examples
|
|
|
|
- run: cargo test --workspace
|
|
|
|
|
|
|
|
- run: cargo install cargo-hack
|
|
|
|
- run: cargo hack --workspace --remove-dev-deps
|
|
|
|
- run: cargo build -p librespot-core --no-default-features
|
|
|
|
- run: cargo build -p librespot-core
|
2021-04-13 09:34:41 +00:00
|
|
|
- run: cargo hack build --each-feature -p librespot-discovery
|
|
|
|
- run: cargo hack build --each-feature -p librespot-playback
|
2021-05-08 20:41:19 +00:00
|
|
|
- run: cargo hack build --each-feature
|
2021-04-09 15:01:30 +00:00
|
|
|
|
|
|
|
test-windows:
|
|
|
|
needs: fmt
|
|
|
|
name: cargo build (${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest]
|
|
|
|
toolchain: [stable]
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Get Rustc version
|
|
|
|
id: get-rustc-version
|
|
|
|
run: echo "::set-output name=version::$(rustc -V)"
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry/index
|
|
|
|
~/.cargo/registry/cache
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
2021-05-08 20:41:19 +00:00
|
|
|
key: ${{ runner.os }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
|
2021-04-09 15:01:30 +00:00
|
|
|
|
|
|
|
- run: cargo build --workspace --examples
|
|
|
|
- run: cargo test --workspace
|
|
|
|
|
|
|
|
- run: cargo install cargo-hack
|
2021-05-08 20:41:19 +00:00
|
|
|
- run: cargo hack --workspace --remove-dev-deps
|
2021-04-09 15:01:30 +00:00
|
|
|
- run: cargo build --no-default-features
|
|
|
|
- run: cargo build
|
2020-12-15 05:16:10 +00:00
|
|
|
|
|
|
|
test-cross-arm:
|
|
|
|
needs: fmt
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: false
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
|
|
|
target: armv7-unknown-linux-gnueabihf
|
|
|
|
toolchain: stable
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-04-09 15:01:30 +00:00
|
|
|
|
2020-12-15 05:16:10 +00:00
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
override: true
|
2021-04-09 15:01:30 +00:00
|
|
|
|
|
|
|
- name: Get Rustc version
|
|
|
|
id: get-rustc-version
|
|
|
|
run: echo "::set-output name=version::$(rustc -V)"
|
|
|
|
shell: bash
|
|
|
|
|
2021-01-31 01:55:47 +00:00
|
|
|
- name: Cache Rust dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry/index
|
|
|
|
~/.cargo/registry/cache
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
2021-05-08 20:41:19 +00:00
|
|
|
key: ${{ runner.os }}-${{ matrix.target }}-${{ steps.get-rustc-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
|
2020-12-15 05:16:10 +00:00
|
|
|
- name: Install cross
|
|
|
|
run: cargo install cross || true
|
|
|
|
- name: Build
|
2022-05-21 19:06:29 +00:00
|
|
|
run: cross build --target ${{ matrix.target }} --no-default-features
|