Skip to content

codecov?

codecov? #410

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs: {}
push:
branches: [ "develop" ]
tags: [ "v**" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
scala: [ '2.12', '2.13', '3.2' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
# - uses: actions/setup-go@v5
# with:
# go-version: '1.21.4' # The Go version to download (if necessary) and use.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x
- name: Build and Test
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} coverage
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
5e21669e-48b4-49ce-82f0-b193010a2ded > TOKEN_CODECOV
- uses: codecov/codecov-action@v4
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
with:
token: ${{ env.TOKEN_CODECOV }}
verbose: true # optional (default = false)
fail_ci_if_error: true
files: "**/cobertura.xml"
# TODO: do we need scoverage.xml? If so files: may be just omitted
# files: cobertura.xml,scoverage.xml
# flags: unittests
checksecret:
runs-on: ubuntu-latest
outputs:
HAVE_SECRETS: ${{ steps.checksecret_job.outputs.HAVE_SECRETS }}
steps:
- id: checksecret_job
env:
TOKEN_BITWARDEN_SM: ${{ secrets.TOKEN_BITWARDEN_SM }}
run: |
echo "HAVE_SECRETS=${{ env.TOKEN_BITWARDEN_SM != '' }}" >> $GITHUB_OUTPUT
publish-alien:
runs-on: ubuntu-latest
needs: [ 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
steps:
- uses: 7mind/github-env@main
with:
java-version: 11
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
637c5cad-a680-4ea3-ac8b-b193010bee40 > TOKEN_NUGET
aa0a790c-4030-4126-bc77-b193010a0f04 > TOKEN_NPM
- name: Publish alien artifacts
run: |
bash .build.sh 2.12 publishIDL
publish-artifacts:
runs-on: ubuntu-latest
needs: [ 'build', 'checksecret' ]
if: needs.checksecret.outputs.HAVE_SECRETS == 'true'
strategy:
matrix:
java: [ '11' ]
scala: [ '2.12', '2.13', '3' ]
steps:
- uses: 7mind/github-env@main
with:
java-version: ${{ matrix.java }}
- uses: bitwarden/sm-action@v2
with:
access_token: ${{ secrets.TOKEN_BITWARDEN_SM }}
secrets: |
994f97a2-97a4-4fe1-806a-b1930104435f > SONATYPE_CREDENTIALS_FILE
749f4227-9f11-4ceb-9121-b1930110c3a9 > OPENSSL_KEY
a2fe5b5b-5f3f-47f8-961c-b1930110cea7 > OPENSSL_IV
- name: Build and Publish to Sonatype
run: |
bash sbtgen.sc --js
bash .build.sh ${{ matrix.scala }} secrets publishScala
all-good:
if: always()
runs-on: ubuntu-latest
needs: [ 'build' ]
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}