From c386232836a0ce21aa468b1785798237961da41d Mon Sep 17 00:00:00 2001 From: Brad House Date: Sun, 15 Dec 2024 16:35:21 -0500 Subject: [PATCH] [bradh352] add workflow files and use forks --- .github/workflows/buildsonic.yaml | 69 +++++++++++++++++++++++++++++++ .gitmodules | 16 +++---- 2 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/buildsonic.yaml diff --git a/.github/workflows/buildsonic.yaml b/.github/workflows/buildsonic.yaml new file mode 100644 index 000000000000..e360c3a97646 --- /dev/null +++ b/.github/workflows/buildsonic.yaml @@ -0,0 +1,69 @@ +name: Build Sonic +on: + push: + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: self-hosted + name: "Build Sonic" + steps: + - name: Install needed packages + run: | + sudo apt-get update + sudo apt-get install -y sudo curl wget ca-certificates cmake ninja-build autoconf automake libtool g++ pkg-config python3-pip git + sudo apt-get dist-upgrade -y --assume-yes + - name: Install j2cli + run: | + pip3 install --user j2cli + - name: Clean up from prior runs + run: | + docker image prune --all --force + docker builder prune --all --force + mydir=`pwd` + sudo rm -rf * + sudo rm -rf .git + cd .. + sudo rm -rf ${mydir} + mkdir -p ${mydir} + cd ${mydir} + sudo rm -rf /var/cache/sonic + - name: Checkout sonic-build + uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 0 + - name: "Make Init" + run: | + sudo mkdir -p /var/cache/sonic/artifacts + sudo chown $USER: /var/cache/sonic/artifacts + sudo chmod 777 /var/cache/sonic/artifacts + make init + - name: Configure Broadcom + run: | + make configure PLATFORM=broadcom SONIC_VERSION_CONTROL_COMPONENTS=none + - name: Make target/sonic-broadcom.bin + run: | + make SONIC_BUILD_JOBS=8 target/sonic-broadcom.bin + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: "sonic-broadcom.bin" + path: 'target/sonic-broadcom.bin' + if-no-files-found: error + overwrite: true + retention-days: 30 + - name: Upload Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: false + make_latest: true + generate_release_notes: true + files: target/sonic-broadcom.bin + fail_on_unmatched_files: true diff --git a/.gitmodules b/.gitmodules index 538ef742790c..d69d6086cd7f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,12 +8,12 @@ branch = 202411 [submodule "sonic-sairedis"] path = src/sonic-sairedis - url = https://github.com/sonic-net/sonic-sairedis - branch = 202411 + url = https://github.com/bradh352/sonic-sairedis + branch = bradh352/202411 [submodule "sonic-swss"] path = src/sonic-swss - url = https://github.com/sonic-net/sonic-swss - branch = 202411 + url = https://github.com/bradh352/sonic-swss + branch = bradh352/202411 [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm url = https://github.com/krambn/p4c-bm @@ -37,8 +37,8 @@ url = https://github.com/p4lang/ptf.git [submodule "src/sonic-utilities"] path = src/sonic-utilities - url = https://github.com/sonic-net/sonic-utilities - branch = 202411 + url = https://github.com/bradh352/sonic-utilities + branch = bradh352/202411 [submodule "platform/broadcom/sonic-platform-modules-arista"] path = platform/broadcom/sonic-platform-modules-arista url = https://github.com/aristanetworks/sonic @@ -48,8 +48,8 @@ branch = 202411 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/sonic-net/sonic-platform-daemons - branch = 202411 + url = https://github.com/bradh352/sonic-platform-daemons + branch = bradh352/202411 [submodule "src/sonic-platform-pde"] path = src/sonic-platform-pde url = https://github.com/sonic-net/sonic-platform-pdk-pde