Skip to content

Commit 10d3bb6

Browse files
committed
only run coverage on master ci
1 parent 3ba4eaf commit 10d3bb6

File tree

2 files changed

+147
-32
lines changed

2 files changed

+147
-32
lines changed

.github/workflows/ci-master.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: CI (master only)
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
build_and_test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
target:
13+
- { name: Linux, os: ubuntu-latest, triple: x86_64-unknown-linux-gnu }
14+
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
15+
- { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc }
16+
- { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu }
17+
- { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc }
18+
version:
19+
- nightly
20+
21+
name: ${{ matrix.target.name }} / ${{ matrix.version }}
22+
runs-on: ${{ matrix.target.os }}
23+
24+
env:
25+
VCPKGRS_DYNAMIC: 1
26+
27+
steps:
28+
- name: Setup Routing
29+
if: matrix.target.os == 'macos-latest'
30+
run: sudo ifconfig lo0 alias 127.0.0.3
31+
32+
- uses: actions/checkout@v2
33+
34+
# install OpenSSL on Windows
35+
- name: Set vcpkg root
36+
if: matrix.target.triple == 'x86_64-pc-windows-msvc' || matrix.target.triple == 'i686-pc-windows-msvc'
37+
run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
38+
- name: Install OpenSSL
39+
if: matrix.target.triple == 'x86_64-pc-windows-msvc'
40+
run: vcpkg install openssl:x64-windows
41+
- name: Install OpenSSL
42+
if: matrix.target.triple == 'i686-pc-windows-msvc'
43+
run: vcpkg install openssl:x86-windows
44+
45+
- name: Install ${{ matrix.version }}
46+
uses: actions-rs/toolchain@v1
47+
with:
48+
toolchain: ${{ matrix.version }}-${{ matrix.target.triple }}
49+
profile: minimal
50+
override: true
51+
52+
# - name: Install MSYS2
53+
# if: matrix.target.triple == 'x86_64-pc-windows-gnu'
54+
# uses: msys2/setup-msys2@v2
55+
# - name: Install MinGW Packages
56+
# if: matrix.target.triple == 'x86_64-pc-windows-gnu'
57+
# run: |
58+
# msys2 -c 'pacman -Sy --noconfirm pacman'
59+
# msys2 -c 'pacman --noconfirm -S base-devel pkg-config'
60+
61+
# - name: Generate Cargo.lock
62+
# uses: actions-rs/cargo@v1
63+
# with: { command: generate-lockfile }
64+
# - name: Cache Dependencies
65+
# uses: Swatinem/[email protected]
66+
67+
- name: Install cargo-hack
68+
uses: actions-rs/cargo@v1
69+
with:
70+
command: install
71+
args: cargo-hack
72+
73+
- name: check lib
74+
if: >
75+
matrix.target.os != 'ubuntu-latest'
76+
&& matrix.target.triple != 'x86_64-pc-windows-gnu'
77+
uses: actions-rs/cargo@v1
78+
with: { command: ci-check-lib }
79+
- name: check lib
80+
if: matrix.target.os == 'ubuntu-latest'
81+
uses: actions-rs/cargo@v1
82+
with: { command: ci-check-lib-linux }
83+
- name: check lib
84+
if: matrix.target.triple == 'x86_64-pc-windows-gnu'
85+
uses: actions-rs/cargo@v1
86+
with: { command: ci-check-min }
87+
88+
- name: check full
89+
# TODO: compile OpenSSL and run tests on MinGW
90+
if: >
91+
matrix.target.os != 'ubuntu-latest'
92+
&& matrix.target.triple != 'x86_64-pc-windows-gnu'
93+
uses: actions-rs/cargo@v1
94+
with: { command: ci-check }
95+
- name: check all
96+
if: matrix.target.os == 'ubuntu-latest'
97+
uses: actions-rs/cargo@v1
98+
with: { command: ci-check-linux }
99+
100+
- name: tests
101+
if: >
102+
matrix.target.os != 'ubuntu-latest'
103+
&& matrix.target.triple != 'x86_64-pc-windows-gnu'
104+
run: |
105+
cargo ci-test
106+
cargo ci-test-rt
107+
cargo ci-test-server
108+
- name: tests
109+
if: matrix.target.os == 'ubuntu-latest'
110+
run: |
111+
sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-rt-linux && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-server-linux"
112+
113+
- name: Clear the cargo caches
114+
run: |
115+
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
116+
cargo-cache
117+
118+
coverage:
119+
name: coverage
120+
runs-on: ubuntu-latest
121+
steps:
122+
- uses: actions/checkout@v2
123+
124+
- name: Install Rust (nightly)
125+
uses: actions-rs/toolchain@v1
126+
with:
127+
toolchain: stable-x86_64-unknown-linux-gnu
128+
profile: minimal
129+
override: true
130+
131+
- name: Generate Cargo.lock
132+
uses: actions-rs/cargo@v1
133+
with: { command: generate-lockfile }
134+
- name: Cache Dependencies
135+
uses: Swatinem/[email protected]
136+
137+
- name: Generate coverage file
138+
if: github.ref == 'refs/heads/master'
139+
run: |
140+
cargo install cargo-tarpaulin
141+
cargo tarpaulin --out Xml --verbose
142+
- name: Upload to Codecov
143+
if: github.ref == 'refs/heads/master'
144+
uses: codecov/codecov-action@v1
145+
with: { file: cobertura.xml }

.github/workflows/ci.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
version:
2121
- 1.52.0 # MSRV for -server and -tls
2222
- stable
23-
- nightly
2423

2524
name: ${{ matrix.target.name }} / ${{ matrix.version }}
2625
runs-on: ${{ matrix.target.os }}
@@ -88,7 +87,7 @@ jobs:
8887
if: matrix.target.triple == 'x86_64-pc-windows-gnu'
8988
uses: actions-rs/cargo@v1
9089
with: { command: ci-check-min }
91-
90+
9291
- name: check full
9392
# TODO: compile OpenSSL and run tests on MinGW
9493
if: >
@@ -118,7 +117,7 @@ jobs:
118117
run: |
119118
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
120119
cargo-cache
121-
120+
122121
build_and_test_lower_msrv:
123122
name: Linux / 1.46 (lower MSRV)
124123
runs-on: ubuntu-latest
@@ -146,35 +145,6 @@ jobs:
146145
run: |
147146
cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean
148147
cargo-cache
149-
150-
coverage:
151-
name: coverage
152-
runs-on: ubuntu-latest
153-
steps:
154-
- uses: actions/checkout@v2
155-
156-
- name: Install Rust (nightly)
157-
uses: actions-rs/toolchain@v1
158-
with:
159-
toolchain: stable-x86_64-unknown-linux-gnu
160-
profile: minimal
161-
override: true
162-
163-
- name: Generate Cargo.lock
164-
uses: actions-rs/cargo@v1
165-
with: { command: generate-lockfile }
166-
- name: Cache Dependencies
167-
uses: Swatinem/[email protected]
168-
169-
- name: Generate coverage file
170-
if: github.ref == 'refs/heads/master'
171-
run: |
172-
cargo install cargo-tarpaulin
173-
cargo tarpaulin --out Xml --verbose
174-
- name: Upload to Codecov
175-
if: github.ref == 'refs/heads/master'
176-
uses: codecov/codecov-action@v1
177-
with: { file: cobertura.xml }
178148
179149
rustdoc:
180150
name: rustdoc

0 commit comments

Comments
 (0)