-
Notifications
You must be signed in to change notification settings - Fork 72
83 lines (71 loc) · 2.46 KB
/
Copy pathrust.yml
File metadata and controls
83 lines (71 loc) · 2.46 KB
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
# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name: Cargo
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
# LINT.IfChange
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Test Cargo project
run: >
cargo test --verbose --locked --workspace --no-fail-fast
--exclude '*_sys'
--exclude 'rs_bindings_from_cc*'
- name: Build not-yet-testable Cargo crates
run: >
cargo build --verbose --locked --workspace
--exclude '*_sys'
--exclude=rs_bindings_from_cc
--exclude=rs_bindings_from_cc_cc_api
--exclude=rs_bindings_from_cc_cc_api_ffi
--exclude=rs_bindings_from_cc_ir_matchers
--exclude=rs_bindings_from_cc_ir_testing
--exclude=rs_bindings_from_cc_multiplatform_ir_testing
--exclude=rs_bindings_from_cc_test_generators
test_cmake:
runs-on: ubuntu-latest
strategy:
matrix:
project: [cmake, cmake_demo]
steps:
- uses: actions/checkout@v6
- name: Install ccache
run: |
curl -sL -o ccache.tar.xz https://github.com/ccache/ccache/releases/download/v4.13.6/ccache-4.13.6-linux-x86_64-glibc.tar.xz
echo "508b2a1217dc6e04a23e967c7b95a0fb45d8a7e16fde9e180919698f2e2be060 ccache.tar.xz" | sha256sum --check
sudo tar -xJf ccache.tar.xz -C /usr/local/bin --strip-components=1 ccache-4.13.6-linux-x86_64-glibc/ccache
- name: Cache CMake with ccache
uses: actions/cache@v5
with:
path: ~/.cache/ccache
key: ${{ runner.os }}-ccache-${{ matrix.project }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ matrix.project }}-
${{ runner.os }}-ccache-
- name: Test CMake project
run: |
cd examples/build_systems/${{ matrix.project }}
cmake -B build -S . -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build build --parallel
cd build
ctest --output-on-failure --parallel 2
test_bazel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build Bazel test project
run: |
cd examples/build_systems/bazel
bazel build --cxxopt=-std=c++20 //:main
# LINT.ThenChange(//depot/copy.bara.sky)