Skip to content

Commit 44150ba

Browse files
committed
CI: Only run coverage jobs on master
1 parent 48cc6c3 commit 44150ba

File tree

2 files changed

+56
-30
lines changed

2 files changed

+56
-30
lines changed

.github/coverage.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
strategy:
32+
matrix:
33+
arch: [ amd64 ]
34+
rust: [ stable ]
35+
steps:
36+
- uses: actions/checkout@v2
37+
with:
38+
submodules: true
39+
- name: Setup Rust toolchain
40+
run: |
41+
rustup toolchain install ${{ matrix.rust }}
42+
rustup default ${{ matrix.rust }}
43+
- name: Cache Cargo
44+
uses: actions/cache@v3
45+
with:
46+
path: /home/runner/.cargo
47+
key: cargo-coverage-cache3-
48+
- name: Run coverage
49+
run: |
50+
rustup toolchain install stable
51+
rustup default stable
52+
cargo install --version 0.18.2 cargo-tarpaulin
53+
cargo tarpaulin --all --out Xml
54+
- name: Report coverage
55+
continue-on-error: true
56+
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/rust.yml

-30
Original file line numberDiff line numberDiff line change
@@ -67,33 +67,3 @@ jobs:
6767
rustup component add rustfmt
6868
- name: Run
6969
run: cargo fmt --all -- --check
70-
71-
coverage:
72-
name: Coverage
73-
runs-on: ubuntu-latest
74-
strategy:
75-
matrix:
76-
arch: [ amd64 ]
77-
rust: [ stable ]
78-
steps:
79-
- uses: actions/checkout@v2
80-
with:
81-
submodules: true
82-
- name: Setup Rust toolchain
83-
run: |
84-
rustup toolchain install ${{ matrix.rust }}
85-
rustup default ${{ matrix.rust }}
86-
- name: Cache Cargo
87-
uses: actions/cache@v3
88-
with:
89-
path: /home/runner/.cargo
90-
key: cargo-coverage-cache3-
91-
- name: Run coverage
92-
run: |
93-
rustup toolchain install stable
94-
rustup default stable
95-
cargo install --version 0.18.2 cargo-tarpaulin
96-
cargo tarpaulin --all --out Xml
97-
- name: Report coverage
98-
continue-on-error: true
99-
run: bash <(curl -s https://codecov.io/bash)

0 commit comments

Comments
 (0)