Skip to content

Commit

Permalink
Merge branch 'master' into SNOW-715510-mfa-token-cache-for-c-api-3
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jszczerbinski authored Jan 7, 2025
2 parents b6fe929 + d3cef59 commit 02cb65c
Show file tree
Hide file tree
Showing 58 changed files with 831 additions and 268 deletions.
90 changes: 76 additions & 14 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
branches:
- '**'

concurrency:
# older builds for the same pull request numer or branch should be cancelled
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
build-test-linux:
name: Build-Test-Linux
Expand All @@ -20,15 +25,29 @@ jobs:
build_type: [ 'Debug', 'Release' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Restore cached deps
id: cache-restore-deps
uses: actions/cache/restore@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ github.event.pull_request.base.sha }}-Linux-dep-cache
if: github.event_name == 'pull_request'
- name: Build
shell: bash
env:
BUILD_TYPE: ${{ matrix.build_type }}
run: ci/build_linux.sh
- uses: actions/setup-python@v1
- name: Cache deps
id: cache-save-deps
uses: actions/cache/save@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ github.sha }}-Linux-dep-cache
if: github.ref_name == github.event.repository.default_branch && matrix.cloud_provider == 'AWS'
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.13'
architecture: 'x64'
- name: Test
shell: bash
Expand All @@ -37,6 +56,7 @@ jobs:
CLOUD_PROVIDER: ${{ matrix.cloud_provider }}
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci/test_linux.sh

build-test-win:
name: Build-Test-Win
runs-on: windows-2019
Expand All @@ -48,17 +68,31 @@ jobs:
vs_version: [ 'VS16' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Restore cached deps
id: cache-restore-deps
uses: actions/cache/restore@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ matrix.platform }}-${{ matrix.vs_version }}-${{ github.event.pull_request.base.sha }}-Win-dep-cache
if: github.event_name == 'pull_request'
- name: Build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
run: ci\build_win.bat
- uses: actions/setup-python@v1
- name: Cache deps
id: cache-save-deps
uses: actions/cache/save@v4
with:
python-version: '3.7'
path: dep-cache
key: ${{ matrix.build_type }}-${{ matrix.platform }}-${{ matrix.vs_version }}-${{ github.sha }}-Win-dep-cache
if: github.ref_name == github.event.repository.default_branch && matrix.cloud_provider == 'AWS'
- uses: actions/setup-python@v5
with:
python-version: '3.13'
architecture: 'x64'
- name: Test
shell: cmd
Expand All @@ -80,17 +114,31 @@ jobs:
vs_version: [ 'VS17' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Restore cached deps
id: cache-restore-deps
uses: actions/cache/restore@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ matrix.platform }}-${{ matrix.vs_version }}-${{ github.event.pull_request.base.sha }}-Win-dep-cache
if: github.event_name == 'pull_request'
- name: Build
shell: cmd
env:
PLATFORM: ${{ matrix.platform }}
BUILD_TYPE: ${{ matrix.build_type }}
VS_VERSION: ${{ matrix.vs_version }}
run: ci\build_win.bat
- uses: actions/setup-python@v1
- name: Cache deps
id: cache-save-deps
uses: actions/cache/save@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ matrix.platform }}-${{ matrix.vs_version }}-${{ github.sha }}-Win-dep-cache
if: github.ref_name == github.event.repository.default_branch && matrix.cloud_provider == 'AWS'
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.13'
architecture: 'x64'
- name: Test
shell: cmd
Expand All @@ -110,15 +158,29 @@ jobs:
build_type: [ 'Debug', 'Release' ]
cloud_provider: [ 'AWS', 'AZURE', 'GCP' ]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Install Homebrew Bash
shell: bash
run: brew install bash
- name: Restore cached deps
id: cache-restore-deps
uses: actions/cache/restore@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ github.event.pull_request.base.sha }}-Mac-dep-cache
if: github.event_name == 'pull_request'
- name: Build
shell: bash
env:
BUILD_TYPE: ${{ matrix.build_type }}
run: ./ci/build_mac.sh
- name: Cache deps
id: cache-save-deps
uses: actions/cache/save@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ github.sha }}-Mac-dep-cache
if: github.ref_name == github.event.repository.default_branch && matrix.cloud_provider == 'AWS'
- name: Test
shell: bash
env:
Expand All @@ -135,16 +197,16 @@ jobs:
matrix:
build_type: [ 'Release' ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
shell: bash
env:
BUILD_TYPE: ${{ matrix.build_type }}
CLIENT_CODE_COVERAGE: 1
run: ci/build_linux.sh
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.13'
architecture: 'x64'
- name: Test on AWS
shell: bash
Expand All @@ -163,7 +225,7 @@ jobs:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: ci/test_linux.sh
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
# without the token code cov may fail because of Github limits https://github.com/codecov/codecov-action/issues/557
token: ${{ secrets.CODE_COV_UPLOAD_TOKEN }}
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Code quality

on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- '**'

jobs:
check-warnings:
name: Extra-Warnings-Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_type: [ 'Release' ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
architecture: 'x64'
- name: Restore cached deps
id: cache-restore-deps
uses: actions/cache/restore@v4
with:
path: dep-cache
key: ${{ matrix.build_type }}-${{ github.event.pull_request.base.sha }}-Linux-dep-cache
if: github.event_name == 'pull_request'
- name: Build
shell: bash
env:
USE_EXTRA_WARNINGS: "true"
BUILD_TYPE: ${{ matrix.build_type }}
run: ci/build_linux.sh
- name: Restore cached warnings
id: cache-restore-warnings
uses: actions/cache/restore@v4
with:
path: warnings.json
key: ${{ github.event.pull_request.base.sha }}-compile-warnings
if: github.event_name == 'pull_request'
- name: Use cached warnings as a baseline
shell: bash
run: cp warnings.json ./ci/scripts/warnings_baseline.json
if: steps.cache-restore-warnings.outputs.cache-hit == 'true'
- name: Warning report
shell: bash
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: ci/scripts/warning_report.sh
- name: Upload build log
uses: actions/upload-artifact@v4
with:
name: build log
path: build.log
- name: Upload warning report
uses: actions/upload-artifact@v4
with:
name: report
path: report.md
- name: Upload warnings
uses: actions/upload-artifact@v4
with:
name: warnings
path: warnings.json
- name: Cache warnings
id: cache-save-warnings
uses: actions/cache/save@v4
with:
path: warnings.json
key: ${{ github.sha }}-compile-warnings
if: github.ref_name == github.event.repository.default_branch

2 changes: 1 addition & 1 deletion .github/workflows/jira_close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: snowflakedb/gh-actions
ref: jira_v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jira_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: snowflakedb/gh-actions
ref: jira_v1
Expand All @@ -37,7 +37,7 @@ jobs:
summary: '${{ github.event.issue.title }}'
description: |
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:3c0352b5-63f7-4e26-9afe-38f6f9f0f4c5"}, "components":[{"id":"19292"}] }'
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:e1f41916-da57-4fe8-b317-116d5229aa51"}, "components":[{"id":"19292"}], "labels": ["oss"], "priority": {"id": "10001"} }'

- name: Update GitHub Issue
uses: ./jira/gajira-issue-update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snyk-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/whitesource-actions
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snyk-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
if: ${{ github.event.pull_request.user.login == 'sfc-gh-snyk-sca-sa' }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Checkout Action
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: snowflakedb/whitesource-actions
token: ${{ secrets.WHITESOURCE_ACTION_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ venv/
wss-*-agent.config
wss-unified-agent.jar
whitesource/
build.log
Loading

0 comments on commit 02cb65c

Please sign in to comment.