Rollback: rXXXXXX #5417
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ya make | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
start-vm: | |
name: Start VM | |
runs-on: trampoline | |
outputs: | |
label: ${{ steps.start-yc-runner.outputs.label }} | |
instance-id: ${{ steps.start-yc-runner.outputs.instance-id }} | |
steps: | |
- name: Start YC runner | |
id: start-yc-runner | |
uses: yc-actions/yc-github-runner@v1 | |
with: | |
mode: start | |
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} | |
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
folder-id: ${{ vars.YC_FOLDER_ID }} | |
image-id: ${{ vars.YC_DEFAULT_IMAGE_ID }} | |
zone-id: ${{ vars.YC_ZONE_ID }} | |
subnet-id: ${{ vars.YC_SUBNET_ID }} | |
cores: 16 | |
memory: 32GB | |
core-fraction: 100 | |
disk-type: network-ssd-nonreplicated | |
disk-size: 372GB | |
checkout: | |
name: Checkout sources | |
needs: start-vm | |
runs-on: ${{ needs.start-vm.outputs.label }} | |
steps: | |
- name: Checkout ytsaurus | |
uses: actions/checkout@v3 | |
with: | |
path: ytsaurus | |
- name: Checkout ydb | |
uses: actions/checkout@v3 | |
with: | |
repository: ydb-platform/ydb | |
ref: 9602cbe953310f3b833b7b99cf5ced4021cdd63b | |
path: ydb | |
build: | |
name: Build | |
needs: | |
- start-vm | |
- checkout | |
with: | |
runs-on-value: ${{ needs.start-vm.outputs.label }} | |
build-python: true | |
build-ytsaurus-ya-make: true | |
build-query-tracker-ya-make-relwithdebinfo: true | |
uses: ./.github/workflows/build-jobs.yaml | |
tag: | |
name: Calculate docker tag | |
needs: | |
- start-vm | |
- build | |
runs-on: ${{ needs.start-vm.outputs.label }} | |
outputs: | |
image-tag: ${{ steps.tag.outputs.IMAGE_TAG }} | |
nightly-image-tag: ${{ steps.tag.outputs.NIGHTLY_IMAGE_TAG }} | |
steps: | |
- name: Calculate docker tag | |
id: tag | |
run: | | |
if [[ $GITHUB_REF =~ main$ ]]; | |
then | |
IMAGE_TAG=dev | |
elif [[ $GITHUB_REF =~ test ]]; | |
then | |
IMAGE_TAG=test | |
elif [[ $GITHUB_REF =~ stable ]]; | |
then | |
IMAGE_TAG=dev-${GITHUB_REF#refs/*/stable/} | |
else | |
IMAGE_TAG=dev-test | |
fi | |
NIGHTLY_IMAGE_TAG=${IMAGE_TAG}-$(git -C ytsaurus show -s --pretty=%cs)-${GITHUB_SHA} | |
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_OUTPUT | |
echo "NIGHTLY_IMAGE_TAG=$NIGHTLY_IMAGE_TAG" >> $GITHUB_OUTPUT | |
docker: | |
name: Docker images | |
needs: | |
- start-vm | |
- tag | |
with: | |
runs-on-value: ${{ needs.start-vm.outputs.label }} | |
publish-query-tracker-ya-make-relwithdebinfo: true | |
image-tag: ${{ needs.tag.outputs.image-tag }} | |
nightly-image-tag: ${{ needs.tag.outputs.nightly-image-tag }} | |
secrets: | |
DOCKER_HUB_LOGIN: ${{ secrets.DOCKER_HUB_LOGIN }} | |
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
uses: ./.github/workflows/docker-jobs.yaml | |
stop-vm: | |
name: Stop VM | |
needs: | |
- start-vm | |
- docker | |
runs-on: trampoline | |
if: ${{ always() }} | |
steps: | |
- name: Stop YC runner | |
uses: yc-actions/yc-github-runner@v1 | |
with: | |
mode: stop | |
yc-sa-json-credentials: ${{ secrets.YC_SA_JSON_CREDENTIALS }} | |
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | |
label: ${{ needs.start-vm.outputs.label }} | |
instance-id: ${{ needs.start-vm.outputs.instance-id }} | |
send-notifications: | |
name: Send notifications | |
needs: | |
- stop-vm | |
runs-on: trampoline | |
if: ${{ failure() }} | |
steps: | |
- name: Send telegram message | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_CHAT_ID }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
disable_web_page_preview: true | |
format: markdown | |
message: | | |
Workflow *${{github.workflow}}* failed: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}. | |
Git ${{github.ref_type}}: *${{github.ref_name}}*. | |
Commit: | |
``` | |
${{github.event.head_commit.message}} | |
``` |