File: ci.yml

package info (click to toggle)
rust-gethostname 0.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 140 kB
  • sloc: makefile: 4
file content (51 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download
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
name: CI

on:
  push:
    # Don't build tags; that's redundant with pushes to main normally.
    tags-ignore: '*'
    # Only build main, for all other branches rely on pull requests.  This
    # avoids duplicate builds for pull requests.
    branches: main
    # Don't build for trivial changes
    paths-ignore:
      - '*.md'
      - 'LICENSE'
  pull_request:


jobs:
  cargo-deny:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: EmbarkStudios/cargo-deny-action@v1

  test:
    name: test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust:
          # Our minimal supported version
          - '1.64.0'
          # The standard Rust version
          - stable
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: clippy,rustfmt
      - run: cargo test
      # Run tests with fixed hostname on Unix systems
      - run: sudo hostname hostname-for-testing
        if: "!contains(matrix.os, 'windows')"
      - run: cargo test -- --ignored
        if: "!contains(matrix.os, 'windows')"
      - run: cargo clippy --all-targets
        if: matrix.rust == 'stable'
      - run: cargo fmt --check
        if: matrix.rust == 'stable'
      - run: cargo doc