11name : ci
22on : [push, pull_request]
33
4+ permissions :
5+ contents : read
6+ id-token : write
7+
48env :
59 RUST_BACKTRACE : 1
610
9498 os :
9599 - ubuntu-latest
96100 rust :
101+ - stable
97102 - nightly
98103 runs-on : ${{ matrix.os }}
99104 steps :
@@ -112,24 +117,49 @@ jobs:
112117
113118 - name : Run Rust tests with coverage
114119 run : .github/scripts/collect-coverage.sh
120+ env :
121+ RUSTC_PROBE_KEEP_PROBE : ${{ matrix.rust == 'nightly' && '1' || '0'}}
115122
116- - name : Upload coverage reports to Codecov
117- uses : codecov/codecov-action@v4.0.1
123+ - name : Upload out if failed
124+ if : failure()
125+ uses : actions/upload-artifact@v4
118126 with :
119- token : ${{ secrets.CODECOV_TOKEN }}
120- files : target/debug/coverage/lcov
121- flags : unittests
127+ name : coverage-failure- ${{ matrix.rust }}-${{ matrix.os }}
128+ path : target/debug/build/git-remote-codecommit-*
129+ retention-days : 1
122130
123131 - name : Archive code coverage results
124132 uses : actions/upload-artifact@v4
125133 with :
126134 name : code-coverage-report-${{ matrix.rust }}-${{ matrix.os }}
127135 path : target/debug/coverage/html/
136+ retention-days : 7
137+
138+ - name : Upload coverage reports to Codecov
139+ uses : codecov/codecov-action@v5
140+ with :
141+ files : target/debug/coverage/lcov
142+ flags : unittests
143+ use_oidc : true
128144
129145 - name : Coveralls Parallel
130146 uses : coverallsapp/github-action@v2
131147 with :
132148 files : target/debug/coverage/lcov
149+ flag-name : code-coverage-report-${{ matrix.rust }}-${{ matrix.os }}
150+ parallel : true
151+
152+ finalize-coveralls-run :
153+ name : Finalize Coveralls Run
154+ needs : [coverage]
155+ if : always()
156+ runs-on : ubuntu-latest
157+ steps :
158+ - name : Finalize Coveralls Run
159+ uses : coverallsapp/github-action@v2
160+ with :
161+ parallel-finished : true
162+ carryforward : code-coverage-report-stable-ubuntu-latest,code-coverage-report-nightly-ubuntu-latest
133163
134164 build-docs :
135165 name : Build Documentation
@@ -217,3 +247,40 @@ jobs:
217247 target/release-lto/git-remote-codecommit
218248 target/release-lto/git-remote-codecommit.exe
219249 compression-level : 0
250+
251+ push-to-codecommit :
252+ name : Push to CodeCommit
253+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'demosdemon/git-remote-codecommit'
254+ needs : [finalize-coveralls-run, build-docs, build-binaries]
255+ runs-on : ubuntu-latest
256+ env :
257+ RUST_BACKTRACE : 1
258+ AWS_REGION : us-west-2
259+ steps :
260+ - name : Checkout
261+ uses : actions/checkout@v4
262+ with :
263+ fetch-depth : 0 # need the history in order to push to CodeCommit
264+
265+ - name : configure aws credentials
266+ uses : aws-actions/configure-aws-credentials@v4.0.2
267+ with :
268+ role-to-assume : arn:aws:iam::339712996426:role/github-git-remote-codecommit
269+ aws-region : ${{ env.AWS_REGION }}
270+
271+ - name : Install Rust
272+ uses : actions-rust-lang/setup-rust-toolchain@v1
273+
274+ - name : Fetch cargo dependencies
275+ run : cargo v --locked
276+
277+ - name : Install git-remote-codecommit
278+ run : cargo v-install --frozen --profile=release-lto --path=crates/git-remote-codecommit
279+
280+ - name : Check version
281+ run : git-remote-codecommit --version
282+
283+ - name : Push to CodeCommit
284+ run : |
285+ git remote add aws codecommit://git-remote-codecommit
286+ git push aws HEAD:refs/heads/main
0 commit comments