-
Notifications
You must be signed in to change notification settings - Fork 4
Add a single foss project to test rules on in ci #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9897662
Add init.sh for yaml-cpp
furtib cb1915a
Add CI for FOSS
furtib 07558fb
Add license
furtib 33cf09e
Add readme for foss
furtib 5044ff0
Rename jobs for easier distinction
furtib 9a8f2d3
Add templates
furtib bc3c31b
Correct path
furtib 5f6336b
Use composite env setup
furtib b374785
Add rhel9 runner
furtib bb96e00
Fix extension
furtib File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,80 @@ | ||
| # Copyright 2023 Ericsson AB | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: codechecker-bazel-foss-tests | ||
|
|
||
| # Triggers the workflow on push or pull request events. | ||
| on: [push, pull_request] | ||
|
|
||
| permissions: read-all | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # TODO: Generalize to handle multiple projects | ||
| # TODO: Add script to run tests locally | ||
| foss_ubuntu_test: | ||
| name: "Test rules on FOSS project: yaml-cpp" | ||
| runs-on: ubuntu-24.04 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup environment | ||
| uses: ./.github/platform_environment_setup/ubuntu | ||
|
|
||
| - name: Setup yaml-cpp | ||
| run: | | ||
| cd test/foss/yaml-cpp | ||
| sh init.sh | ||
|
|
||
| - name: Run Bazel CodeChecker | ||
| run: | | ||
| cd test/foss/yaml-cpp/test-proj | ||
| bazel build :codechecker_test | ||
|
|
||
| - name: Run Per-File Bazel CodeChecker | ||
| run: | | ||
| cd test/foss/yaml-cpp/test-proj | ||
| bazel build :code_checker_test | ||
|
|
||
| foss_rhel_test: | ||
| name: "Test rules on FOSS project: yaml-cpp" | ||
| runs-on: ubuntu-24.04 | ||
| container: redhat/ubi9:latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup environment | ||
| uses: ./.github/platform_environment_setup/rhel9 | ||
|
|
||
| - name: Setup yaml-cpp | ||
| run: | | ||
| cd test/foss/yaml-cpp | ||
| sh init.sh | ||
|
|
||
| - name: Run Bazel CodeChecker | ||
| run: | | ||
| cd test/foss/yaml-cpp/test-proj | ||
| bazel build :codechecker_test | ||
|
|
||
| - name: Run Per-File Bazel CodeChecker | ||
| run: | | ||
| cd test/foss/yaml-cpp/test-proj | ||
| bazel build :code_checker_test |
This file contains hidden or 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 hidden or 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 hidden or 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 @@ | ||
| 6.5.0 |
This file contains hidden or 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,20 @@ | ||
| #---------------------------------------------------- | ||
|
|
||
| load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") | ||
|
|
||
| local_repository( | ||
| name = "bazel_codechecker", | ||
| path = "../../../../", | ||
| ) | ||
|
furtib marked this conversation as resolved.
|
||
|
|
||
| load( | ||
| "@bazel_codechecker//src:tools.bzl", | ||
| "register_default_codechecker", | ||
| "register_default_python_toolchain", | ||
| ) | ||
|
|
||
| register_default_python_toolchain() | ||
|
|
||
| register_default_codechecker() | ||
|
|
||
| #---------------------------------------------------- | ||
This file contains hidden or 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,57 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Copyright 2023 Ericsson AB | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| git clone --recurse https://github.com/jbeder/yaml-cpp.git test-proj | ||
| cd test-proj | ||
| git checkout yaml-cpp-0.7.0 | ||
|
|
||
| # This file must be in the root of the project to be analyzed for bazelisk to work | ||
| cp ../../templates/.bazelversion ./.bazelversion | ||
|
|
||
| # Add codechecker to the project | ||
| cat <<EOF >> BUILD.bazel | ||
| #------------------------------------------------------- | ||
|
|
||
| # codechecker rules | ||
| load( | ||
| "@bazel_codechecker//src:codechecker.bzl", | ||
| "codechecker_test", | ||
| ) | ||
| load( | ||
| "@bazel_codechecker//src:code_checker.bzl", | ||
| "code_checker_test", | ||
| ) | ||
|
|
||
|
|
||
| codechecker_test( | ||
| name = "codechecker_test", | ||
| targets = [ | ||
| ":yaml-cpp", | ||
| ], | ||
| ) | ||
|
|
||
| code_checker_test( | ||
| name = "code_checker_test", | ||
| targets = [ | ||
| ":yaml-cpp", | ||
| ], | ||
| ) | ||
|
|
||
| #------------------------------------------------------- | ||
| EOF | ||
|
|
||
| # Add codechecker_bazel repo to WORKSPACE | ||
| cat ../../templates/WORKSPACE.template >> WORKSPACE |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.