-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into test-pr-tnf-secrets
- Loading branch information
Showing
23 changed files
with
1,740 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[maxbodylength] | ||
disabled = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,11 +32,8 @@ env: | |
|
||
jobs: | ||
lint: | ||
name: Run Linter and Vet | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, macos-latest] | ||
name: Run Linters and Vet | ||
runs-on: ubuntu-latest | ||
env: | ||
SHELL: /bin/bash | ||
|
||
|
@@ -59,84 +56,50 @@ jobs: | |
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# TODO: golangci-lint team recommends using a GitHub Action to perform golangci-lint responsibilities. However | ||
# there does not appear to be a way to honor our existing .golangci.yml. For now, mimic developer behavior. | ||
- name: Install golangci-lint | ||
run: make install-lint | ||
|
||
- name: Install checkmake (Linux) | ||
run: curl --location --output $CM_BIN --silent $CM_URL_LINUX | ||
if: runner.os == 'Linux' | ||
|
||
- name: Install checkmake (MacOS) | ||
run: brew install checkmake | ||
if: runner.os == 'macOS' | ||
|
||
- run: chmod +x $CM_BIN | ||
if: runner.os == 'Linux' | ||
|
||
- name: Install hadolint (Linux) | ||
run: | | ||
curl \ | ||
--location \ | ||
--output /usr/local/bin/hadolint \ | ||
https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 | ||
chmod +x /usr/local/bin/hadolint | ||
if: runner.os == 'Linux' | ||
|
||
- name: Install hadolint (MacOS) | ||
- name: Install checkmake | ||
run: | | ||
brew install hadolint | ||
if: runner.os == 'macOS' | ||
curl --location --output $CM_BIN --silent $CM_URL_LINUX | ||
chmod +x $CM_BIN | ||
- name: Install shfmt (Linux) | ||
run: make install-shfmt | ||
if: runner.os == 'Linux' | ||
- name: Install Shfmt | ||
uses: mfinelli/setup-shfmt@v3 | ||
|
||
- name: Install shfmt (MacOS) | ||
run: brew install shfmt | ||
if: runner.os == 'macOS' | ||
- name: Golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54 | ||
args: --timeout 10m0s | ||
|
||
- name: make lint | ||
run: make lint | ||
- name: Checkmake | ||
run: checkmake --config=.checkmake Makefile | ||
|
||
- name: make vet | ||
run: make vet | ||
action-linters: | ||
name: Checkmake, hadolint, markdownlint, shellcheck, shfmt, typos, yamllint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
curl --location --output $CM_BIN --silent $CM_URL_LINUX | ||
chmod +x $CM_BIN | ||
$CM_BIN Makefile | ||
- uses: hadolint/[email protected] | ||
- name: Hadolint | ||
uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
recursive: true | ||
- uses: nosborn/[email protected] | ||
|
||
- name: Shfmt | ||
run: shfmt -d *.sh script | ||
|
||
- name: Markdownlint | ||
uses: nosborn/[email protected] | ||
with: | ||
files: . | ||
ignore_files: cmd/tnf/generate/catalog/{INTRO,TEST_CASE_CATALOG}.md | ||
- uses: ludeeus/action-shellcheck@master | ||
- uses: mfinelli/setup-shfmt@v3 | ||
- run: shfmt -d *.sh script | ||
- uses: crate-ci/typos@master | ||
- uses: ibiqlik/action-yamllint@v3 | ||
with: | ||
config_data: | | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 180 | ||
level: warning | ||
trailing-spaces: | ||
level: warning | ||
brackets: | ||
level: warning | ||
empty-lines: | ||
level: warning | ||
|
||
- name: ShellCheck | ||
uses: ludeeus/action-shellcheck@master | ||
|
||
- name: Typos | ||
uses: crate-ci/typos@master | ||
|
||
- name: Yamllint | ||
uses: ibiqlik/action-yamllint@v3 | ||
with: | ||
config_file: .yamllint.yml | ||
|
||
- name: Go vet | ||
run: make vet | ||
unit-tests: | ||
name: Run Unit Tests | ||
runs-on: ${{ matrix.os }} | ||
|
@@ -376,7 +339,7 @@ jobs: | |
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.21.2 | ||
# Prepare collector to be used when running smoke tests | ||
- name: Check out `Collector` | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -387,11 +350,6 @@ jobs: | |
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
|
||
- name: Deploy collector and mysql | ||
uses: ./collector/.github/actions/prepare-collector-for-use | ||
with: | ||
working_directory: collector | ||
|
||
# Perform smoke tests using a TNF container. | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
@@ -430,7 +388,7 @@ jobs: | |
- name: 'Test: Run Smoke Tests in a TNF container' | ||
run: TNF_LOG_LEVEL=${TNF_SMOKE_TESTS_LOG_LEVEL} TNF_ENABLE_DATA_COLLECTION=true ./run-tnf-container.sh ${{ env.TESTING_CMD_PARAMS }} -l "${SMOKE_TESTS_GINKGO_LABELS_FILTER}" | ||
|
||
# Perform tests on collector | ||
# Prepare collector to be used when running smoke tests | ||
- name: Check out `Collector` | ||
uses: actions/checkout@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 180 | ||
level: warning | ||
trailing-spaces: | ||
level: warning | ||
brackets: | ||
level: warning | ||
empty-lines: | ||
level: warning | ||
no_warnings: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.