-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ main ] | ||
schedule: | ||
- cron: '35 21 * * 4' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: [self-hosted, X64] | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'go' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
steps: | ||
- name: Clear repository | ||
run: sudo rm -fr $GITHUB_WORKSPACE && mkdir $GITHUB_WORKSPACE | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
Check notice Code scanning / CodeQL Workflow Should Use Default Setup Note
CodeQL Action could use default setup instead of advanced configuration.
|
||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
name: Unit Test | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
go-version: [1.20.x, 1.21.x, 1.22.x, 1.23.x] | ||
runner_arch: [ubuntu-24.04-arm, macos-latest] | ||
|
||
runs-on: ${{ matrix.runner_arch }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
${{ github.workspace }}/go.sum | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Unit Test | ||
run: | | ||
GOMAXPROCS=4 go test -race -covermode=atomic -coverprofile=coverage.txt ./... $(go list ./... | grep -v -E 'loader|jit|avx|x86|sse') | ||
- name: Data Race | ||
run: | | ||
./scripts/test_race.sh | ||
- name: Generic Test | ||
if: ${{ !startsWith(matrix.go-version, '1.17.') }} | ||
run: GOMAXPROCS=4 go test -v -race ./generic_test | ||
|
||
- name: Codecov | ||
run: bash <(curl -s https://codecov.io/bash) | ||
Check warning Code scanning / CodeQL Workflow does not contain permissions Medium test
Actions Job or Workflow does not set permissions
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
name: Unit Test | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x] | ||
runner_arch: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.runner_arch }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
${{ github.workspace }}/go.sum | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
|
||
- name: Unit Test JIT | ||
run: | | ||
GOMAXPROCS=4 go test -race -covermode=atomic -coverprofile=coverage.txt ./... | ||
- name: Unit Test VM | ||
run: | | ||
SONIC_USE_OPTDEC=1 SONIC_USE_FASTMAP=1 SONIC_ENCODER_USE_VM=1 GOMAXPROCS=4 go test -race -covermode=atomic -coverprofile=coverage.txt ./... | ||
- name: Loader Test | ||
run: | | ||
cd ./loader | ||
go test -v -race ./... | ||
- name: Data Race | ||
run: | | ||
./scripts/test_race.sh | ||
- name: PCSP Test | ||
env: | ||
GOVERSION: ${{ matrix.go-version }} | ||
run: python3 ./scripts/test_pcsp.py | ||
|
||
- name: Generic Test JIT | ||
if: ${{ !startsWith(matrix.go-version, '1.17.') }} | ||
run: GOMAXPROCS=4 go test -v -race ./generic_test | ||
|
||
- name: Generic Test VM | ||
if: ${{ !startsWith(matrix.go-version, '1.17.') }} | ||
run: GOMAXPROCS=4 SONIC_USE_OPTDEC=1 SONIC_USE_FASTMAP=1 SONIC_ENCODER_USE_VM=1 go test -v -race ./generic_test | ||
|
||
- name: Codecov | ||
run: bash <(curl -s https://codecov.io/bash) | ||
Check warning Code scanning / CodeQL Workflow does not contain permissions Medium test
Actions Job or Workflow does not set permissions
|
This file was deleted.