Skip to content

Commit 5166a08

Browse files
authored
CI: Only run coverage jobs on master (#2214)
1 parent d87f6a4 commit 5166a08

File tree

2 files changed

+63
-38
lines changed

2 files changed

+63
-38
lines changed

.github/workflows/coverage.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Coverage
19+
20+
# Trigger only on pushes to master, not pull requests
21+
on:
22+
push:
23+
branches:
24+
- master
25+
26+
jobs:
27+
28+
coverage:
29+
name: Coverage
30+
runs-on: ubuntu-latest
31+
# Note runs outside of a container
32+
# otherwise we get this error:
33+
# Failed to run tests: ASLR disable failed: EPERM: Operation not permitted
34+
steps:
35+
- uses: actions/checkout@v2
36+
with:
37+
submodules: true
38+
- name: Setup Rust toolchain
39+
run: |
40+
rustup toolchain install stable
41+
rustup default stable
42+
- name: Install protobuf compiler in /protoc
43+
run: |
44+
sudo mkdir /protoc
45+
sudo chmod a+rwx /protoc
46+
cd /protoc
47+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_64.zip
48+
unzip protoc-21.4-linux-x86_64.zip
49+
- name: Cache Cargo
50+
uses: actions/cache@v3
51+
with:
52+
path: /home/runner/.cargo
53+
key: cargo-coverage-cache3-
54+
- name: Run coverage
55+
run: |
56+
export PATH=$PATH:/protoc/bin
57+
rustup toolchain install stable
58+
rustup default stable
59+
cargo install --version 0.18.2 cargo-tarpaulin
60+
cargo tarpaulin --all --out Xml
61+
- name: Report coverage
62+
continue-on-error: true
63+
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/rust.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -98,41 +98,3 @@ jobs:
9898
rustup component add rustfmt
9999
- name: Run
100100
run: cargo fmt --all -- --check
101-
102-
103-
coverage:
104-
name: Coverage
105-
runs-on: ubuntu-latest
106-
# Note runs outside of a container
107-
# otherwise we get this error:
108-
# Failed to run tests: ASLR disable failed: EPERM: Operation not permitted
109-
steps:
110-
- uses: actions/checkout@v2
111-
with:
112-
submodules: true
113-
- name: Setup Rust toolchain
114-
run: |
115-
rustup toolchain install stable
116-
rustup default stable
117-
- name: Install protobuf compiler in /protoc
118-
run: |
119-
sudo mkdir /protoc
120-
sudo chmod a+rwx /protoc
121-
cd /protoc
122-
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_64.zip
123-
unzip protoc-21.4-linux-x86_64.zip
124-
- name: Cache Cargo
125-
uses: actions/cache@v3
126-
with:
127-
path: /home/runner/.cargo
128-
key: cargo-coverage-cache3-
129-
- name: Run coverage
130-
run: |
131-
export PATH=$PATH:/protoc/bin
132-
rustup toolchain install stable
133-
rustup default stable
134-
cargo install --version 0.18.2 cargo-tarpaulin
135-
cargo tarpaulin --all --out Xml
136-
- name: Report coverage
137-
continue-on-error: true
138-
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)