-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (84 loc) · 2.72 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Rust
on:
push:
pull_request:
release:
types: [released]
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all -- --check
doc2readme:
runs-on: ubuntu-latest
container:
image: ghcr.io/msrd0/cargo-doc2readme:nightly
steps:
- uses: actions/checkout@v3
- run: apk add --no-cache libxrandr-dev
- run: cargo doc2readme --check --all-features --expand-macros --manifest-path more-wallpapers/Cargo.toml
cargo_publish:
if: ${{ github.event_name == 'release' }}
needs: [rustfmt, doc2readme, check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Install xrandr
run: sudo apt-get update && sudo apt-get install -y libxrandr-dev
- run: cargo publish --package more-wallpapers --token ${{ secrets.CRATES_IO_TOKEN }}
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
features: ["", --all-features, --features rand, --features fallback]
rust_version: [stable, 1.65]
workspace: [-p more-wallpapers]
include:
- workspace: -p setmw
rust_version: stable
os: ubuntu
- workspace: -p setmw
rust_version: stable
os: windows
- workspace: -p setmw
rust_version: stable
os: macos
exclude:
- os: windows
features: --features rand
- os: windows
features: ""
- os: macos
features: --features rand
- os: macos
features: ""
name: "${{ matrix.os }} ${{ matrix.rust_version }} ${{ matrix.features }} ${{ matrix.workspace }}"
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust_version }}
id: "rust-toolchain"
- uses: actions/cache@v3
with:
path: |
~/.cargo/git
~/.cargo/registry
target
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} ${{matrix.features}} ${{ matrix.workspace }} Lock ${{hashFiles('Cargo.lock')}}"
restore-keys: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}"
- name: Install xrandr
if: ${{ matrix.os == 'ubuntu' }}
run: sudo apt-get update && sudo apt-get install -y libxrandr-dev
- run: cargo test ${{ matrix.workspace }} ${{ matrix.features }}
env:
RUST_BACKTRACE: 1