Skip to content
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

Build on arm and add release workflow #2

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
Thank you for considering a contribution!

Please be aware that we currently won't merge 3rd party PRs because this repository
is temporary. We are waiting for the decision of the OpenTelemetry technical
commitee on the donation of this repository.

In case the donation gets accepted, this repository will move to the [GitHub open-telemetry organization](https://github.com/open-telemetry),
which requires signing a different CLA. At that point we will start working on reviewing and merging 3rd party PRs.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ on:
branches: [main]
pull_request:
branches: ["**"]
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: true
max-parallel: 2
Expand All @@ -32,6 +33,8 @@ jobs:
sudo make install
cd zycore
sudo make install
- name: Check out
uses: actions/checkout@v4
- name: Set up Go ${{matrix.go}}
uses: actions/setup-go@v5
with:
Expand All @@ -54,8 +57,6 @@ jobs:
sudo find "$INSTALL_DIR/include" -type d -exec chmod +x {} \;
sudo find "$INSTALL_DIR/include" -type f -exec chmod +r {} \;
rm "$PB_FILE"
- name: Check out
uses: actions/checkout@v4
- name: Linter
run: |
go version
Expand All @@ -64,15 +65,16 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 2
matrix:
go: ["stable"]
os: ["arm-4core-linux", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- name: Install dependencies
run: sudo apt-get install -y llvm clang dwz cmake curl unzip
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends gcc make llvm clang dwz cmake curl unzip
- name: Install Zydis
shell: bash
run: |
Expand All @@ -98,11 +100,13 @@ jobs:
- name: Install gRPC dependencies
env:
PB_URL: "https://github.com/protocolbuffers/protobuf/releases/download/v24.4/"
PB_FILE: "protoc-24.4-linux-x86_64.zip"
PB_FILE: "protoc-24.4-linux-%arch%.zip"
INSTALL_DIR: "/usr/local"
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
ARCH=$(uname -m | sed 's/aarch64/aarch_64/')
PB_FILE=$(echo $PB_FILE | sed "s/%arch%/$ARCH/g")
curl -LO "$PB_URL/$PB_FILE"
sudo unzip "$PB_FILE" -d "$INSTALL_DIR" 'bin/*' 'include/*'
sudo chmod +xr "$INSTALL_DIR/bin/protoc"
Expand All @@ -114,7 +118,15 @@ jobs:
- name: Build
run: |
echo $PATH
make test
make
- name: Tests
# Tests fail on arm
if: matrix.os != 'arm-4core-linux'
run: |
make test
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: agent-${{ matrix.os == 'arm-4core-linux' && 'aarch64' || 'x86_64' }}
path: otel-profiling-agent

36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build
uses: ./.github/workflows/build.yml

release:
env:
RELEASE_VERSION: ${{ github.ref_name }}
needs: build
name: Release
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create assets
run: |
tar czf otel-profiling-agent-${RELEASE_VERSION}-aarch64.tar.gz -C agent-aarch64 .
tar czf otel-profiling-agent-${RELEASE_VERSION}-x86_64.tar.gz -C agent-x86_64 .
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "otel-profiling-agent-v*.tar.gz"
allowUpdates: true
omitBody: true
draft: true
tag: ${{ env.RELEASE_VERSION }}
Loading