forked from signalwire/freeswitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request signalwire#2657 from signalwire/workflow
[GHA] Refactor workflows
- Loading branch information
Showing
13 changed files
with
1,153 additions
and
210 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,24 @@ | ||
ARG BUILDER_IMAGE=signalwire/freeswitch-public-ci-base:bookworm-amd64 | ||
|
||
FROM ${BUILDER_IMAGE} | ||
|
||
ARG MAINTAINER_EMAIL="andrey@signalwire.com" | ||
|
||
LABEL org.opencontainers.image.authors="${MAINTAINER_EMAIL}" | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
COPY --from=sofia-sip / /usr/src/sofia-sip | ||
COPY --from=freeswitch / /usr/src/freeswitch | ||
|
||
RUN cd /usr/src/freeswitch && \ | ||
./ci.sh -t unit-test -a configure -c sofia-sip -p "/usr/src/sofia-sip" && \ | ||
./ci.sh -t unit-test -a build -c sofia-sip -p "/usr/src/sofia-sip" && \ | ||
./ci.sh -t unit-test -a install -c sofia-sip -p "/usr/src/sofia-sip" && \ | ||
./ci.sh -t unit-test -a configure -c freeswitch -p "/usr/src/freeswitch" && \ | ||
./ci.sh -t unit-test -a build -c freeswitch -p "/usr/src/freeswitch" && \ | ||
./ci.sh -t unit-test -a install -c freeswitch -p "/usr/src/freeswitch" | ||
|
||
WORKDIR /usr/src/freeswitch/tests/unit | ||
|
||
ENTRYPOINT ["/usr/src/freeswitch/tests/unit/run-tests.sh"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Scan build (Static Analysis) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
freeswitch_ref: | ||
description: 'FreeSWITCH repository ref' | ||
required: false | ||
type: string | ||
sofia-sip_ref: | ||
description: 'Sofia-Sip repository ref' | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
scan-build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: signalwire/freeswitch-public-ci-base:bookworm-amd64 | ||
options: --privileged | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
|
||
steps: | ||
- name: Checkout Sofia-Sip | ||
if: inputs.sofia-sip_ref == '' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: freeswitch/sofia-sip | ||
path: sofia-sip | ||
|
||
- name: Checkout Sofia-Sip (via ref) | ||
if: inputs.sofia-sip_ref != '' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: freeswitch/sofia-sip | ||
ref: ${{ inputs.sofia-sip_ref }} | ||
path: sofia-sip | ||
|
||
- name: Checkout FreeSWITCH (via ref) | ||
if: inputs.freeswitch_ref != '' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.freeswitch_ref }} | ||
path: freeswitch | ||
|
||
- name: Checkout FreeSWITCH | ||
if: inputs.freeswitch_ref == '' | ||
uses: actions/checkout@v4 | ||
with: | ||
path: freeswitch | ||
|
||
- name: Configure, Build and Install Sofia-Sip | ||
shell: bash | ||
working-directory: freeswitch | ||
run: | | ||
./ci.sh -t scan-build -a configure -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" | ||
./ci.sh -t scan-build -a build -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" | ||
./ci.sh -t scan-build -a install -c sofia-sip -p "$GITHUB_WORKSPACE/sofia-sip" | ||
- name: Configure FreeSWITCH | ||
shell: bash | ||
working-directory: freeswitch | ||
run: | | ||
./ci.sh -t scan-build -a configure -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" | ||
- name: Run scan-build analysis | ||
shell: bash | ||
working-directory: freeswitch | ||
run: | | ||
./ci.sh -t scan-build -a build -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" | ||
- name: Check analysis results | ||
if: always() | ||
shell: bash | ||
working-directory: freeswitch | ||
run: | | ||
./ci.sh -t scan-build -a validate -c freeswitch -p "$GITHUB_WORKSPACE/freeswitch" | ||
- name: Upload Scan-Build logs | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: scan-build-logs | ||
path: freeswitch/scan-build | ||
retention-days: 3 | ||
if-no-files-found: ignore | ||
compression-level: 9 | ||
|
||
- name: Notify run tests result to slack | ||
if: | | ||
failure() && | ||
github.event_name == 'push' && | ||
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10') | ||
uses: signalwire/actions-template/.github/actions/slack@main | ||
with: | ||
CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }} | ||
MESSAGE: Scan-Build ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Static analysis failed. | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
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,101 @@ | ||
name: Unit-tests D-in-D | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
freeswitch_ref: | ||
description: 'FreeSWITCH repository ref' | ||
required: false | ||
type: string | ||
sofia-sip_ref: | ||
description: 'Sofia-Sip repository ref' | ||
required: false | ||
type: string | ||
|
||
env: | ||
MAX_CONTAINERS: 8 | ||
NUM_CPU_PER_CONTAINER: 1 | ||
DOCKER_BUILD_SUMMARY: false | ||
DOCKER_BUILD_CHECKS_ANNOTATIONS: false | ||
DOCKER_BUILD_RECORD_UPLOAD: false | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: signalwire/freeswitch-public-ci-base:bookworm-amd64 | ||
options: --privileged | ||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
ASAN_OPTIONS: log_path=stdout:disable_coredump=0:unmap_shadow_on_exit=1:fast_unwind_on_malloc=0 | ||
|
||
steps: | ||
- name: Checkout Sofia-Sip (via ref) | ||
if: inputs.sofia-sip_ref != '' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: freeswitch/sofia-sip | ||
ref: ${{ inputs.sofia-sip_ref }} | ||
path: sofia-sip | ||
|
||
- name: Checkout Sofia-Sip | ||
if: inputs.sofia-sip_ref == '' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: freeswitch/sofia-sip | ||
path: sofia-sip | ||
|
||
- name: Checkout FreeSWITCH (via ref) | ||
if: inputs.freeswitch_ref != '' | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.freeswitch_ref }} | ||
path: freeswitch | ||
|
||
- name: Checkout FreeSWITCH | ||
if: inputs.freeswitch_ref == '' | ||
uses: actions/checkout@v4 | ||
with: | ||
path: freeswitch | ||
|
||
- name: Run Unit-Test containers and collect artifacts | ||
id: unit_tests | ||
shell: bash | ||
run: | | ||
echo "logs_path=${GITHUB_WORKSPACE}/freeswitch/tests/unit/logs" >> $GITHUB_OUTPUT | ||
"${GITHUB_WORKSPACE}/freeswitch/tests/unit/run-tests-docker.sh" \ | ||
--base-image signalwire/freeswitch-public-ci-base:bookworm-amd64 \ | ||
--cpus ${{ env.NUM_CPU_PER_CONTAINER }} \ | ||
--image-tag ci.local \ | ||
--max-containers ${{ env.MAX_CONTAINERS }} \ | ||
--output-dir "${GITHUB_WORKSPACE}/freeswitch/tests/unit/logs" \ | ||
--sofia-sip-path "${GITHUB_WORKSPACE}/sofia-sip" \ | ||
--freeswitch-path "${GITHUB_WORKSPACE}/freeswitch" | ||
test -d "/cores" && ls -lah /cores | ||
cd "${GITHUB_WORKSPACE}/freeswitch/tests/unit/" && \ | ||
./collect-test-logs.sh --dir logs --print | ||
- name: Upload Unit-Test logs | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: test-results-${{ github.sha }}-${{ github.run_number }} | ||
path: ${{ steps.unit_tests.outputs.logs_path }} | ||
retention-days: 3 | ||
if-no-files-found: ignore | ||
compression-level: 9 | ||
|
||
- name: Notify run tests result to slack | ||
if: | | ||
failure() && | ||
github.event_name == 'push' && | ||
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v1.10') | ||
uses: signalwire/actions-template/.github/actions/slack@main | ||
with: | ||
CHANNEL: ${{ secrets.SLACK_DEVOPS_CI_CHANNEL }} | ||
MESSAGE: Unit-Tests ${{ github.repository }} > <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>. Some tests are failing. | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
Oops, something went wrong.