Skip to content

Commit 7c93935

Browse files
committed
ci: invoke the tool when collecting coverage
1 parent a230d5f commit 7c93935

File tree

1 file changed

+39
-26
lines changed

1 file changed

+39
-26
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,52 @@ jobs:
106106
- name: Run Tests (all features)
107107
run: cargo test --verbose --workspace --all-features --frozen
108108

109+
- name: Build Binaries
110+
if: matrix.rust == 'nightly'
111+
run: cargo build --verbose --bins --workspace --frozen --profile=release-lto
112+
113+
- name: Print diagnostics
114+
if: matrix.rust == 'nightly' && runner.os == 'Windows'
115+
shell: powershell
116+
run: |
117+
Get-ChildItem -Path .\target\release-lto
118+
119+
- name: Print diagnostics
120+
if: matrix.rust == 'nightly' && runner.os != 'Windows'
121+
run: |
122+
ls -Al ./target/release-lto
123+
124+
- name: Upload Binaries as GitHub artifact
125+
if: matrix.rust == 'nightly'
126+
uses: actions/[email protected]
127+
with:
128+
name: git-remote-codecommit-${{ matrix.os }}
129+
path: |
130+
target/release-lto/git-remote-codecommit
131+
target/release-lto/git-remote-codecommit.exe
132+
compression-level: 0
133+
134+
- name: Configure AWS credentials
135+
if: github.repository == 'demosdemon/git-remote-codecommit'
136+
uses: aws-actions/[email protected]
137+
env:
138+
RUST_BACKTRACE: 1
139+
AWS_REGION: us-west-2
140+
with:
141+
role-to-assume: arn:aws:iam::339712996426:role/github-git-remote-codecommit
142+
aws-region: ${{ env.AWS_REGION }}
143+
109144
- name: Run Rust tests with coverage
110145
env:
111146
CARGO_INCREMENTAL: 0
112147
RUSTFLAGS: "-Cinstrument-coverage"
113148
shell: bash
114149
run: |
115-
cargo build --verbose --workspace --tests --frozen
150+
cargo build --verbose --workspace --all-targets --frozen
116151
export LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw'
152+
export PATH="$PWD/target/debug:$PATH"
153+
git remote add aws codecommit://git-remote-codecommit
154+
git fetch aws main --depth=1 || true # if this is a fork the credentials won't be set
117155
cargo test --verbose --workspace --frozen
118156
mkdir -p ./target/debug/coverage/
119157
grcov . \
@@ -158,31 +196,6 @@ jobs:
158196
flag-name: code-coverage-report-${{ matrix.rust }}-${{ matrix.os }}${{ matrix.rust != 'nightly' && matrix.rustc_bootstrap == '1' && '-bootstrap' || '' }}
159197
parallel: true
160198

161-
- name: Build Binaries
162-
if: matrix.rust == 'nightly'
163-
run: cargo build --verbose --bins --workspace --frozen --profile=release-lto
164-
165-
- name: Print diagnostics
166-
if: matrix.rust == 'nightly' && runner.os == 'Windows'
167-
shell: powershell
168-
run: |
169-
Get-ChildItem -Path .\target\release-lto
170-
171-
- name: Print diagnostics
172-
if: matrix.rust == 'nightly' && runner.os != 'Windows'
173-
run: |
174-
ls -Al ./target/release-lto
175-
176-
- name: Upload Binaries as GitHub artifact
177-
if: matrix.rust == 'nightly'
178-
uses: actions/[email protected]
179-
with:
180-
name: git-remote-codecommit-${{ matrix.os }}
181-
path: |
182-
target/release-lto/git-remote-codecommit
183-
target/release-lto/git-remote-codecommit.exe
184-
compression-level: 0
185-
186199
finalize-coveralls-run:
187200
name: Finalize Coveralls Run
188201
needs: [check-and-test]

0 commit comments

Comments
 (0)