Skip to content

Commit

Permalink
workflows: update build and packaging to fix (#64)
Browse files Browse the repository at this point in the history
* workflows: update build and packaging to fix

Signed-off-by: Patrick Stephens <[email protected]>

* ci: add codeowners

Signed-off-by: Patrick Stephens <[email protected]>

* workflows: fix centos 7 checkout

Signed-off-by: Patrick Stephens <[email protected]>

---------

Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Dec 19, 2024
1 parent 68c90d4 commit 3589a3b
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 3 deletions.
58 changes: 57 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,43 @@ jobs:
git clone --recursive https://github.com/calyptia/ctraces.git
shell: bash

- name: Check out the branch (1.8.3 version of Git)
env:
BRANCH_NAME: ${{ github.head_ref }}
run: |
git checkout "$BRANCH_NAME"
shell: bash
working-directory: ctraces

- name: Run compilation
run: |
cmake3 -DCTR_TESTS=on -DCTR_DEV=on .
make
shell: bash
working-directory: ctraces

build-debian:
name: Debian Buster build to confirm no issues once used downstream
runs-on: ubuntu-latest
container: debian:buster
steps:
- name: Set up base image dependencies
run: |
apt-get update
apt-get install -y build-essential cmake make git
shell: bash

- uses: actions/checkout@v4
with:
submodules: true

- name: Run compilation
run: |
cmake -DCTR_TESTS=On .
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
shell: bash

build-unix-arm64:
name: Build sources on arm64 for ${{ matrix.os }} - ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
Expand All @@ -78,7 +108,7 @@ jobs:
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu20.04
distro: ubuntu_latest
run: |
apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -144,3 +174,29 @@ jobs:
# dependencies_debian: ''
cmakeflags: '-DCTR_TESTS=On -DCMT_DEV=on .'
build_command: make all

# this job provides the single required status for PRs to be merged into main.
# instead of updating the protected branch status in github, developers can update the needs section below
# to require additional status checks to protect main.
# the job uses the alls-green action to get around the github issue that treats a "skipped" required status check
# as passed. github will skip a job if an upstream needed job fails, which would defeat the purpose of this required
# status check.
test-required-checks-complete:
# note: this step always has to run in order to check if the dependent jobs passed. by default github skips running a job
# if the needed jobs upstream failed.
if: always()
needs:
- build-windows
- build-centos
- build-debian
- build-unix-arm64
- build-unix-amd64
- build-analysis-tests
name: Required checks complete
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
32 changes: 30 additions & 2 deletions .github/workflows/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
name: Build the ${{matrix.format}} packages
with:
arch: aarch64
distro: ubuntu20.04
distro: ubuntu_latest
run: |
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
file \
rpm \
make
make
cmake .
echo ${{ matrix.format }} | awk '{print toupper($0)}' | xargs -I{} cpack -G {}
Expand Down Expand Up @@ -69,11 +69,39 @@ jobs:
path: |
./*.${{matrix.format}}
build-macos-packages-arm64:
name: build macOS Apple Silicon packages
strategy:
fail-fast: true
matrix:
config:
- format: productbuild
arch: apple
ext: pkg
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build the ${{matrix.config.format}} packages
run: |
cmake . -DCPACK_GENERATOR=${{ matrix.config.format }}
echo ${{ matrix.config.format }} | xargs -I{} cpack -G {}
- name: Store the master package artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.format }}-${{matrix.config.arch}}
path: |
./*-${{matrix.config.arch}}.${{matrix.config.ext}}
release:
name: Create release and upload packages
needs:
- build-distro-packages-amd64
- build-distro-packages-arm64
- build-macos-packages-arm64
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
7 changes: 7 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Global Owners
# -------------
* @edsiper @leonardo-albertovich

# CI
# -------------------------
/.github/ @niedbalski @patrick-stephens @celalettin1286

0 comments on commit 3589a3b

Please sign in to comment.