Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
commit_hash:b92f2dc7ec8029457b49fac9268c5d5a42aceb5e
  • Loading branch information
MikailBag committed Jan 30, 2025
1 parent 2da0374 commit 5c807f8
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/postcommit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
on:
push:
branches:
- main
jobs:
ya:
name: Postcommit checks
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: tespkg/actions-cache@91b54a6e03abb8fcec12d3743633d23a1cfcd269
with:
endpoint: storage.yandexcloud.net
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
bucket: ${{ secrets.CACHE_BUCKET }}
# Don't bother trying github cache, we don't fit in its 10GB limit
use-fallback: false
key: v1-${{ github.sha }}
restore-keys: |
v1-
path: ~/.ya/build
- name: Run ya make
run: ./ya make ./perforator -DCI=github -DSTRIP -r --musl

102 changes: 102 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
on:
release:
types:
# TODO: is this right?
- created
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: tespkg/actions-cache/restore@91b54a6e03abb8fcec12d3743633d23a1cfcd269
with:
endpoint: storage.yandexcloud.net
accessKey: ${{ secrets.CACHE_ACCESS_KEY }}
secretKey: ${{ secrets.CACHE_SECRET_KEY }}
bucket: ${{ secrets.CACHE_BUCKET }}
# Don't bother trying github cache, we don't fit in its 10GB limit
use-fallback: false
key: v1-${{ github.sha }}
restore-keys: |
v1-
path: ~/.ya/build
- name: Build binaries
run: |
./ya make -r --musl -DSTRIP ./perforator/bundle
- uses: actions/upload-artifact@v4
with:
name: binaries
path: ./perforator/bundle
build-autofdo:
runs-on: ubuntu-24.04
steps:
- uses: actions/cache@v4
with:
path: ./autofdo/build
key: v1-${{ github.sha }}
restore-keys: |
v1-
- name: Build AutoFDO
run: |
sudo apt-get update
sudo apt-get install -y libunwind-dev libgflags-dev libssl-dev libelf-dev protobuf-compiler \
cmake libzstd-dev clang g++ git build-essential
git clone --recursive --depth 1 https://github.com/google/autofdo.git
cd autofdo
git checkout 8f9ab68921f364a6433086245ca3f19befacfeb1
git submodule update --init --recursive
mkdir build
cd build
cmake -DENABLE_TOOL=LLVM -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release ../
make -j $(nproc) create_llvm_prof
- uses: actions/upload-artifact@v4
with:
name: autofdo
path: ./autofdo/build/create_llvm_prof
release-cli:
runs-on: ubuntu-24.04
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
name: binaries
- name: Attach binaries to release
run: |
chmod +x ./cli
chmod +x ./migrate
gh -R ${{ github.repository }} release upload ${{ github.event.release.tag_name }} ./cli ./migrate
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-images:
runs-on: ubuntu-24.04
needs:
- build
- build-autofdo
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: binaries
path: dist
- uses: actions/download-artifact@v4
with:
name: autofdo
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push images
run: |
mv ./create_llvm_prof ./dist/
chmod +x ./dist/create_llvm_prof
function build {
chmod +x ./dist/$1
docker build -f perforator/deploy/docker/Dockerfile.prebuilt --target $1 --push --tag ghcr.io/${{ github.repository }}/$1:${{ github.event.release.tag_name }} ./dist
}
build agent
build gc
build migrate
build offline_processing
build proxy
build storage
build web
2 changes: 2 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
".":"perforator/opensource/github_toplevel",
".github/workflows/postcommit.yaml":"perforator/opensource/github_toplevel/.github/workflows/postcommit.yaml",
".github/workflows/release.yaml":"perforator/opensource/github_toplevel/.github/workflows/release.yaml",
"CONTRIBUTING.md":"perforator/opensource/github_toplevel/CONTRIBUTING.md",
"LICENSE":"perforator/opensource/github_toplevel/LICENSE",
"README.md":"perforator/opensource/github_toplevel/README.md",
Expand Down

0 comments on commit 5c807f8

Please sign in to comment.