Skip to content

Commit eb02199

Browse files
committed
CI: Only run coverage jobs on master
1 parent d9d04cd commit eb02199

File tree

2 files changed

+56
-30
lines changed

2 files changed

+56
-30
lines changed

.github/coverage.yml

Lines changed: 56 additions & 0 deletions
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

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

0 commit comments

Comments
 (0)