1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Conditionally use Codecov secret (#9626)

This commit is contained in:
Matt Bishop
2024-06-13 15:08:52 -04:00
committed by GitHub
parent 8be17c28f0
commit 2d43a12ce9

View File

@@ -1,5 +1,4 @@
--- name: Testing
name: Run tests
on: on:
workflow_dispatch: workflow_dispatch:
@@ -8,22 +7,13 @@ on:
- "main" - "main"
- "rc" - "rc"
- "hotfix-rc-*" - "hotfix-rc-*"
pull_request_target: pull_request:
types: [opened, synchronize] types: [opened, synchronize]
defaults:
run:
shell: bash
jobs: jobs:
check-run:
name: Check PR run
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
test: test:
name: Run tests name: Run tests
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: check-run
permissions: permissions:
checks: write checks: write
contents: read contents: read
@@ -75,14 +65,26 @@ jobs:
reporter: jest-junit reporter: jest-junit
fail-on-error: true fail-on-error: true
- name: Check for Codecov secret
id: check-codecov-secret
run: |
if [ "${{ secrets.CODECOV_TOKEN }}" != '' ]; then
echo "available=true" >> $GITHUB_OUTPUT;
else
echo "available=false" >> $GITHUB_OUTPUT;
fi
- name: Upload to codecov.io - name: Upload to codecov.io
uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0 uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
if: steps.check-codecov-secret.outputs.available == 'true'
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
rust: rust:
name: rust - ${{ matrix.os }} name: Run Rust tests on ${{ matrix.os }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }} runs-on: ${{ matrix.os || 'ubuntu-latest' }}
permissions:
contents: read
strategy: strategy:
matrix: matrix:
@@ -92,7 +94,7 @@ jobs:
- windows-latest - windows-latest
steps: steps:
- name: Rust version check - name: Check Rust version
run: rustup --version run: rustup --version
- name: Install gnome-keyring - name: Install gnome-keyring