• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI (bors)
2
3on:
4  push:
5    branches:
6      - auto-libc
7      - try
8
9permissions: {}
10jobs:
11  docker_linux_tier1:
12    permissions:
13      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
14      contents: read # to fetch code (actions/checkout)
15
16    name: Docker Linux Tier1
17    runs-on: ubuntu-22.04
18    strategy:
19      fail-fast: true
20      matrix:
21        target: [
22          i686-unknown-linux-gnu,
23          x86_64-unknown-linux-gnu,
24        ]
25    steps:
26      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
27        with:
28          github_token: "${{ secrets.GITHUB_TOKEN }}"
29      - uses: actions/checkout@v3
30      - name: Setup Rust toolchain
31        run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
32      - name: Execute run-docker.sh
33        run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
34
35  macos:
36    permissions:
37      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
38      contents: read # to fetch code (actions/checkout)
39
40    name: macOS
41    runs-on: macos-12
42    strategy:
43      fail-fast: true
44      matrix:
45        target: [
46          x86_64-apple-darwin,
47        ]
48    steps:
49      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
50        with:
51          github_token: "${{ secrets.GITHUB_TOKEN }}"
52      - uses: actions/checkout@v3
53      - name: Setup Rust toolchain
54        run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
55      - name: Execute run.sh
56        run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
57
58  windows:
59    permissions:
60      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
61      contents: read # to fetch code (actions/checkout)
62
63    name: Windows
64    runs-on: windows-2022
65    env:
66      OS: windows
67    strategy:
68      fail-fast: true
69      matrix:
70        include:
71          - target: x86_64-pc-windows-gnu
72            env:
73              ARCH_BITS: 64
74              ARCH: x86_64
75          - target: x86_64-pc-windows-msvc
76          # Disabled because broken:
77          #  https://github.com/rust-lang/libc/issues/1592
78          #- target: i686-pc-windows-gnu
79          #  env:
80          #    ARCH_BITS: 32
81          #    ARCH: i686
82          - target: i686-pc-windows-msvc
83    steps:
84      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
85        with:
86          github_token: "${{ secrets.GITHUB_TOKEN }}"
87      - uses: actions/checkout@v3
88      - name: Self-update rustup
89        run: rustup self update
90        shell: bash
91      - name: Setup Rust toolchain
92        run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
93        shell: bash
94      - name: Execute run.sh
95        run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }}
96        shell: bash
97
98  style_check:
99    permissions:
100      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
101      contents: read # to fetch code (actions/checkout)
102
103    name: Style check
104    runs-on: ubuntu-22.04
105    steps:
106      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
107        with:
108          github_token: "${{ secrets.GITHUB_TOKEN }}"
109      - uses: actions/checkout@v3
110      - name: Setup Rust toolchain
111        run: sh ./ci/install-rust.sh
112      - name: Check style
113        run: sh ci/style.sh
114
115  docker_linux_tier2:
116    permissions:
117      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
118      contents: read # to fetch code (actions/checkout)
119
120    name: Docker Linux Tier2
121    needs: [docker_linux_tier1, style_check]
122    runs-on: ubuntu-22.04
123    strategy:
124      fail-fast: true
125      max-parallel: 12
126      matrix:
127        target: [
128          # FIXME: Mysterious failures in CI, see
129          # https://github.com/rust-lang/libc/issues/2081
130          # aarch64-linux-android,
131          aarch64-unknown-linux-gnu,
132          aarch64-unknown-linux-musl,
133          arm-linux-androideabi,
134          arm-unknown-linux-gnueabihf,
135          arm-unknown-linux-musleabihf,
136          asmjs-unknown-emscripten,
137          i686-linux-android,
138          i686-unknown-linux-musl,
139          mips-unknown-linux-gnu,
140          mips-unknown-linux-musl,
141          # FIXME: Somehow failed on CI
142          # https://github.com/rust-lang/libc/runs/1659882216
143          # mips64-unknown-linux-gnuabi64,
144          # mips64el-unknown-linux-gnuabi64,
145          mipsel-unknown-linux-musl,
146          powerpc-unknown-linux-gnu,
147          powerpc64-unknown-linux-gnu,
148          powerpc64le-unknown-linux-gnu,
149          s390x-unknown-linux-gnu,
150          riscv64gc-unknown-linux-gnu,
151          # FIXME: A recent nightly causes a linker failure:
152          # https://github.com/rust-lang/rust/issues/76679
153          # See this comment for more details:
154          # https://github.com/rust-lang/libc/pull/2225#issuecomment-880696737
155          #wasm32-wasi,
156          sparc64-unknown-linux-gnu,
157          wasm32-unknown-emscripten,
158          x86_64-linux-android,
159          x86_64-unknown-linux-gnux32,
160          x86_64-unknown-linux-musl,
161          # FIXME: It seems some items in `src/unix/mod.rs`
162          # aren't defined on redox actually.
163          # x86_64-unknown-redox,
164        ]
165    steps:
166      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
167        with:
168          github_token: "${{ secrets.GITHUB_TOKEN }}"
169      - uses: actions/checkout@v3
170      - name: Setup Rust toolchain
171        run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
172      - name: Execute run-docker.sh
173        run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }}
174
175  # These targets are tier 3 or otherwise need to have CI build std via -Zbuild-std.
176  # Because of this, only the nightly compiler can be used on these targets.
177  docker_linux_build_std:
178    permissions:
179      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
180      contents: read # to fetch code (actions/checkout)
181
182    if: ${{ false }} # This is currently broken
183    name: Docker Linux Build-Std Targets
184    needs: [docker_linux_tier1, style_check]
185    runs-on: ubuntu-22.04
186    strategy:
187      fail-fast: true
188      max-parallel: 12
189      matrix:
190        target: [
191          armv7-unknown-linux-uclibceabihf
192        ]
193    steps:
194      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
195        with:
196          github_token: "${{ secrets.GITHUB_TOKEN }}"
197      - uses: actions/checkout@v3
198      - name: Setup Rust toolchain
199        run: TOOLCHAIN=nightly INSTALL_RUST_SRC=1 sh ./ci/install-rust.sh
200      - name: Execute run-docker.sh
201        run: LIBC_CI=1 TOOLCHAIN=nightly LIBC_CI_ZBUILD_STD=1 sh ./ci/run-docker.sh ${{ matrix.target }}
202
203  # devkitpro's pacman needs to be connected from Docker.
204  docker_switch:
205    permissions:
206      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
207      contents: read # to fetch code (actions/checkout)
208
209    name: Docker Switch
210    needs: [docker_linux_tier1, style_check]
211    runs-on: ubuntu-22.04
212    steps:
213      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
214        with:
215          github_token: "${{ secrets.GITHUB_TOKEN }}"
216      - uses: actions/checkout@v3
217      - name: Setup Rust toolchain
218        run: sh ./ci/install-rust.sh
219      - name: Execute run-docker.sh
220        run: LIBC_CI=1 sh ./ci/run-docker.sh switch
221
222  build_channels_linux:
223    permissions:
224      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
225      contents: read # to fetch code (actions/checkout)
226
227    name: Build Channels Linux
228    needs: docker_linux_tier2
229    runs-on: ubuntu-22.04
230    env:
231      OS: linux
232    strategy:
233      fail-fast: true
234      max-parallel: 5
235      matrix:
236        toolchain: [
237          stable,
238          beta,
239          nightly,
240          1.13.0,
241          1.19.0,
242          1.24.0,
243          1.25.0,
244          1.30.0,
245        ]
246    steps:
247      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
248        with:
249          github_token: "${{ secrets.GITHUB_TOKEN }}"
250      - uses: actions/checkout@v3
251      - name: Setup Rust toolchain
252        run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
253      - name: Execute build.sh
254        run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
255
256  build_channels_macos:
257    permissions:
258      contents: read # to fetch code (actions/checkout)
259
260    name: Build Channels macOS
261    needs: macos
262    # FIXME: Use macOS 11 for now as CI failed with a linker error on macOS 12 image:
263    # ld: in /.../x86_64-apple-darwin/lib/libstd-a4729905.rlib(rust.metadata.bin),
264    # archive member 'rust.metadata.bin' with length 2958149 is not mach-o or llvm bitcode file '/.../x86_64-apple-darwin/lib/libstd-a4729905.rlib'
265    # Possibly related: https://github.com/actions/runner-images/issues/6350
266    runs-on: macos-11
267    env:
268      OS: macos
269    strategy:
270      fail-fast: true
271      max-parallel: 4
272      matrix:
273        toolchain: [
274          stable,
275          beta,
276          nightly,
277          1.13.0,
278          1.19.0,
279          1.24.0,
280          1.25.0,
281          1.30.0,
282        ]
283    steps:
284      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
285        with:
286          github_token: "${{ secrets.GITHUB_TOKEN }}"
287      - uses: actions/checkout@v3
288      - name: Setup Rust toolchain
289        run: TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/install-rust.sh
290      - name: Execute build.sh
291        run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
292
293  build_channels_windows:
294    permissions:
295      contents: read # to fetch code (actions/checkout)
296
297    name: Build Channels Windows
298    runs-on: windows-2022
299    env:
300      OS: windows
301    strategy:
302      fail-fast: true
303      matrix:
304        toolchain: [
305          1.19.0,
306          1.24.0,
307          1.25.0,
308          1.30.0,
309          stable,
310        ]
311    steps:
312      - uses: actions/checkout@v3
313      - name: Self-update rustup
314        run: rustup self update
315        shell: bash
316      - name: Execute build.sh
317        run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
318        shell: bash
319
320  semver_linux:
321    if: ${{ false }} # This is currently broken
322    name: Semver Linux
323    runs-on: ubuntu-22.04
324    continue-on-error: true
325    steps:
326      - uses: actions/checkout@v3
327      - name: Setup Rust toolchain
328        # Should update the semverver revision in semver.sh if we touch nightly ver.
329        run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
330      - name: Check breaking changes
331        run: sh ci/semver.sh linux
332
333  semver_macos:
334    if: ${{ false }} # This is currently broken
335    name: Semver macOS
336    runs-on: macos-12
337    continue-on-error: true
338    steps:
339      - uses: actions/checkout@v3
340      - name: Setup Rust toolchain
341        # Pin nightly version to make semverver compilable.
342        run: TOOLCHAIN=nightly-2022-05-23 sh ./ci/install-rust.sh
343      - name: Check breaking changes
344        run: sh ci/semver.sh macos
345
346  docs:
347    permissions:
348      actions: write # to cancel workflows (rust-lang/simpleinfra/github-actions/cancel-outdated-builds)
349      contents: read # to fetch code (actions/checkout)
350
351    name: Generate documentation
352    runs-on: ubuntu-22.04
353    needs: docker_linux_tier2
354    steps:
355      - uses: rust-lang/simpleinfra/github-actions/cancel-outdated-builds@master
356        with:
357          github_token: "${{ secrets.GITHUB_TOKEN }}"
358      - uses: actions/checkout@v3
359      - name: Setup Rust toolchain
360        run: sh ./ci/install-rust.sh
361      - name: Generate documentation
362        run: LIBC_CI=1 sh ci/dox.sh
363
364  # These jobs doesn't actually test anything, but they're only used to tell
365  # bors the build completed, as there is no practical way to detect when a
366  # workflow is successful listening to webhooks only.
367  #
368  # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
369
370  end_success:
371    name: bors build finished
372    if: github.event.pusher.name == 'bors' && success()
373    runs-on: ubuntu-22.04
374    needs: [
375      docker_linux_tier1,
376      docker_linux_tier2,
377      #docker_linux_build_std,
378      macos,
379      windows,
380      style_check,
381      docker_switch,
382      build_channels_linux,
383      build_channels_macos,
384      build_channels_windows,
385      docs,
386    ]
387
388    steps:
389      - name: Mark the job as successful
390        run: exit 0
391
392  end_failure:
393    name: bors build finished
394    if: github.event.pusher.name == 'bors' && (failure() || cancelled())
395    runs-on: ubuntu-22.04
396    needs: [
397      docker_linux_tier1,
398      docker_linux_tier2,
399      #docker_linux_build_std,
400      macos,
401      windows,
402      style_check,
403      docker_switch,
404      build_channels_linux,
405      build_channels_macos,
406      build_channels_windows,
407      docs,
408    ]
409
410    steps:
411      - name: Mark the job as a failure
412        run: exit 1
413