-
Notifications
You must be signed in to change notification settings - Fork 2
add GHCR privare image for fast lighter separated CI #13
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
9 commits
Select commit
Hold shift + click to select a range
8284e8b
add ghct image auto-builder action
dariopellegrino00 27ef4a6
update static checks using GHCR image
dariopellegrino00 609fd3c
add separated build action check
dariopellegrino00 3a0b75e
fix ca-certificate error in workflow using image
dariopellegrino00 48e70c9
add group to avoid multiple concurrent sdk build actions
dariopellegrino00 f32bb7b
remove trigger in SDK image build; allow image build only manually vi…
dariopellegrino00 3186654
fix edited wrong workflow; build insted of sdk-image
dariopellegrino00 a0c7284
Update .github/workflows/code-static-checks.yml
dariopellegrino00 dd2d933
Update .github/workflows/code-static-checks.yml
dariopellegrino00 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,57 @@ | ||
|
|
||
| name: Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-22.04 | ||
| container: | ||
| image: ghcr.io/voismart/freeswitch-sdk:ci | ||
| credentials: | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Cache ccache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/ccache | ||
| key: ${{ runner.os }}-ccache-${{ github.ref }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-ccache- | ||
|
|
||
| - name: Configure & Build | ||
| run: | | ||
| set -eux | ||
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| cmake --build build -j"$(nproc)" | ||
|
|
||
| - name: Upload build artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: build-artifacts | ||
| path: | | ||
| build/**/*.so | ||
| build/**/*.a | ||
| build/**/*.dll | ||
| build/**/*.dylib | ||
| build/**/*.exe | ||
| build/compile_commands.json | ||
| if-no-files-found: ignore | ||
This file was deleted.
Oops, something went wrong.
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,78 @@ | ||
| name: Static Checks | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read # to pull from private GHCR | ||
|
|
||
| jobs: | ||
| analyze: | ||
| runs-on: ubuntu-22.04 | ||
| container: | ||
| image: ghcr.io/voismart/freeswitch-sdk:ci # make org name dynamic in case of future org name changes | ||
| credentials: | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Configure | ||
| run: | | ||
| set -eux | ||
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
| cmake -S . -B build \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ | ||
| -DCMAKE_C_COMPILER=clang \ | ||
| -DCMAKE_CXX_COMPILER=clang++ \ | ||
| -DCMAKE_C_COMPILER_LAUNCHER=ccache \ | ||
| -DCMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
|
|
||
| - name: Analyze | ||
| run: | | ||
| set -eux | ||
| scan-build --status-bugs cmake --build build -j"$(nproc)" | ||
|
|
||
| FILES="$(git ls-files '*.c' '*.cc' '*.cpp' '*.cxx' | grep -v '^buffer/' | grep -v '^libs/')" | ||
| if [ -n "$FILES" ]; then | ||
| clang-tidy -p build $FILES \ | ||
| --warnings-as-errors='clang-analyzer-*,bugprone-*,performance-*' | ||
| else | ||
| echo "No source files found for clang-tidy analysis." | ||
| fi | ||
|
|
||
| cppcheck --enable=warning,performance,portability --std=c++17 --force \ | ||
| --project=build/compile_commands.json \ | ||
| --suppress=missingIncludeSystem \ | ||
| -i build -i buffer -i libs 2> cppcheck-warn.log | ||
|
|
||
| cppcheck --enable=style --std=c++17 --force \ | ||
| --project=build/compile_commands.json \ | ||
| --suppress=missingIncludeSystem \ | ||
| -i build -i buffer -i libs 2> cppcheck-style.log || true | ||
|
|
||
| if [ -s cppcheck-style.log ]; then | ||
| echo "Style issues found by cppcheck:" | ||
| cat cppcheck-style.log | ||
| else | ||
| echo "No style issues found by cppcheck." | ||
| fi | ||
|
|
||
| - name: Upload logs | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: static-checks-logs | ||
| path: | | ||
| cppcheck-warn.log | ||
| cppcheck-style.log | ||
| build/compile_commands.json |
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,53 @@ | ||
|
|
||
| name: Build & Publish SDK image | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ghcr-publish # run in the same group do not overlap | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write # to push to GHCR | ||
|
|
||
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Compute lowercase image name | ||
| run: | | ||
| owner_lc=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]') | ||
| echo "IMAGE=ghcr.io/${owner_lc}/freeswitch-sdk" >> $GITHUB_ENV | ||
|
|
||
| - name: Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.IMAGE }} | ||
| tags: | | ||
| type=raw,value=ci | ||
| type=sha,format=short | ||
| type=ref,event=branch | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build & push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: Dockerfile.ci | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=registry,ref=${{ env.IMAGE }}:cache | ||
| cache-to: type=registry,ref=${{ env.IMAGE }}:cache,mode=max |
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
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.