Debian Codegraph @

.cargo/vendor/byteorder/.github/workflows/ci.yml

raw
1 name: ci
2 on:
3 pull_request:
4 branches:
5 - master
6 push:
7 branches:
8 - master
9 schedule:
10 - cron: '00 01 * * *'
11
12 # The section is needed to drop write-all permissions that are granted on
13 # `schedule` event. By specifying any permission explicitly all others are set
14 # to none. By using the principle of least privilege the damage a compromised
15 # workflow can do (because of an injection or compromised third party tool or
16 # action) is restricted. Currently the worklow doesn't need any additional
17 # permission except for pulling the code. Adding labels to issues, commenting
18 # on pull-requests, etc. may need additional permissions:
19 #
20 # Syntax for this section:
21 # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
22 #
23 # Reference for how to assign permissions on a job-by-job basis:
24 # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
25 #
26 # Reference for available permissions that we can enable if needed:
27 # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
28 permissions:
29 # to fetch code (actions/checkout)
30 contents: read
31
32 jobs:
33 test:
34 name: test
35 env:
36 # For some builds, we use cross to test on 32-bit and big-endian
37 # systems.
38 CARGO: cargo
39 # When CARGO is set to CROSS, TARGET is set to `--target matrix.target`.
40 # Note that we only use cross on Linux, so setting a target on a
41 # different OS will just use normal cargo.
42 TARGET:
43 # Bump this as appropriate. We pin to a version to make sure CI
44 # continues to work as cross releases in the past have broken things
45 # in subtle ways.
46 CROSS_VERSION: v0.2.5
47 runs-on: ${{ matrix.os }}
48 strategy:
49 fail-fast: false
50 matrix:
51 include:
52 - build: pinned
53 os: ubuntu-latest
54 rust: 1.60.0
55 - build: stable
56 os: ubuntu-latest
57 rust: stable
58 - build: beta
59 os: ubuntu-latest
60 rust: beta
61 - build: nightly
62 os: ubuntu-latest
63 rust: nightly
64 - build: macos
65 os: macos-latest
66 rust: stable
67 - build: win-msvc
68 os: windows-latest
69 rust: stable
70 - build: win-gnu
71 os: windows-latest
72 rust: stable-x86_64-gnu
73 - build: stable-x86
74 os: ubuntu-latest
75 rust: stable
76 target: i686-unknown-linux-gnu
77 - build: stable-aarch64
78 os: ubuntu-latest
79 rust: stable
80 target: aarch64-unknown-linux-gnu
81 - build: stable-powerpc64
82 os: ubuntu-latest
83 rust: stable
84 target: powerpc64-unknown-linux-gnu
85 - build: stable-s390x
86 os: ubuntu-latest
87 rust: stable
88 target: s390x-unknown-linux-gnu
89 steps:
90 - name: Checkout repository
91 uses: actions/checkout@v4
92 - name: Install Rust
93 uses: dtolnay/rust-toolchain@master
94 with:
95 toolchain: ${{ matrix.rust }}
96 - name: Use Cross
97 if: matrix.os == 'ubuntu-latest' && matrix.target != ''
98 run: |
99 # In the past, new releases of 'cross' have broken CI. So for now, we
100 # pin it. We also use their pre-compiled binary releases because cross
101 # has over 100 dependencies and takes a bit to compile.
102 dir="$RUNNER_TEMP/cross-download"
103 mkdir "$dir"
104 echo "$dir" >> $GITHUB_PATH
105 cd "$dir"
106 curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
107 tar xf cross-x86_64-unknown-linux-musl.tar.gz
108 echo "CARGO=cross" >> $GITHUB_ENV
109 echo "TARGET=--target ${{ matrix.target }}" >> $GITHUB_ENV
110 - name: Show command used for Cargo
111 run: |
112 echo "cargo command is: ${{ env.CARGO }}"
113 echo "target flag is: ${{ env.TARGET }}"
114 - name: Show CPU info for debugging
115 if: matrix.os == 'ubuntu-latest'
116 run: lscpu
117 - name: Build
118 run: ${{ env.CARGO }} build --verbose $TARGET
119 - name: Build (no default)
120 run: ${{ env.CARGO }} build --verbose $TARGET --no-default-features
121 - name: Build docs
122 run: ${{ env.CARGO }} doc --verbose $TARGET
123
124 # Our dev dependencies evolve more rapidly than we'd like, so only run
125 # tests when we aren't pinning the Rust version.
126 - name: Tests
127 if: matrix.build != 'pinned'
128 run: ${{ env.CARGO }} test --verbose $TARGET
129
130 - name: Tests (no default, lib only)
131 if: matrix.build != 'pinned'
132 run: ${{ env.CARGO }} test --verbose --no-default-features --lib $TARGET
133
134 - name: Tests (i128)
135 if: matrix.build != 'pinned'
136 run: ${{ env.CARGO }} test --verbose --features i128 $TARGET
137
138 - name: Tests (no default, lib only, i128)
139 if: matrix.build != 'pinned'
140 run: ${{ env.CARGO }} test --verbose --no-default-features --features i128 --lib $TARGET
141
142 - name: Compile benchmarks
143 if: matrix.build == 'nightly'
144 run: cargo bench --verbose --no-run $TARGET
145
146 - name: Compile benchmarks (no default)
147 if: matrix.build == 'nightly'
148 run: cargo bench --verbose --no-run --no-default-features $TARGET
149
150 - name: Compile benchmarks (i128)
151 if: matrix.build == 'nightly'
152 run: cargo bench --verbose --no-run --features i128 $TARGET
153
154 - name: Compile benchmarks (no default, i128)
155 if: matrix.build == 'nightly'
156 run: cargo bench --verbose --no-run --no-default-features --features i128 $TARGET
157
158 miri:
159 runs-on: ubuntu-latest
160 steps:
161 - name: Checkout repository
162 uses: actions/checkout@v4
163 - name: Install Rust
164 uses: dtolnay/rust-toolchain@master
165 with:
166 # We use nightly here so that we can use miri I guess?
167 toolchain: nightly
168 components: miri
169 - name: Run full test suite
170 run: cargo miri test --verbose
171
172 rustfmt:
173 runs-on: ubuntu-latest
174 steps:
175 - name: Checkout repository
176 uses: actions/checkout@v4
177 - name: Install Rust
178 uses: dtolnay/rust-toolchain@master
179 with:
180 toolchain: stable
181 components: rustfmt
182 - name: Check formatting
183 run: cargo fmt -- --check