diff --git a/.github/workflows/postcommit.yaml b/.github/workflows/postcommit.yaml new file mode 100644 index 00000000..c2d2f4cc --- /dev/null +++ b/.github/workflows/postcommit.yaml @@ -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 + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..5a14b534 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 + diff --git a/.mapping.json b/.mapping.json index 3f8a7bf5..0a4a769c 100644 --- a/.mapping.json +++ b/.mapping.json @@ -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",