Skip to content

SNOW-1735927: Add code coverage #34

SNOW-1735927: Add code coverage

SNOW-1735927: Add code coverage #34

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
- prep-**
workflow_dispatch:
inputs:
logLevel:
default: warning
description: "Log level"
required: true
tags:
description: "Test scenario tags"
concurrency:
# older builds for the same pull request number or branch should be cancelled
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
shell: bash
env:
WHITESOURCE_API_KEY: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}
run: ./ci/build.sh
test-windows:
needs: build
name: ${{ matrix.runConfig.cloud }} Windows java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AWS', javaVersion: '11', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '17', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID' }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.runConfig.javaVersion }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
- name: Tests
shell: cmd
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: ci\\test_windows.bat
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: target\\jacoco-tests\\jacoco.xml
token: ${{ secrets.CODECOV_TOKEN }}
test-mac:
needs: build
name: ${{ matrix.runConfig.cloud }} Mac java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AWS', javaVersion: '11', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '17', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID' }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.runConfig.javaVersion }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Homebrew Bash
shell: bash
run: brew install bash
- name: Tests
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: bash ./ci/test.sh
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: target/jacoco-tests/jacoco.xml
token: ${{ secrets.CODECOV_TOKEN }}
test-linux:
needs: build
name: ${{ matrix.runConfig.cloud }} Linux java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'GCP', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '21', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AWS', javaVersion: '11', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '17', testGroups: 'UNIT,STANDARD,HYBRID' },
{ cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID' }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: ${{ matrix.runConfig.javaVersion }}
distribution: 'temurin'
cache: maven
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Tests
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: ./ci/test.sh
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: target/jacoco-tests/jacoco.xml
token: ${{ secrets.CODECOV_TOKEN }}