ci: remove nix build-and-commit workflow
Browse filesNo longer needed — activation is now built via setup.py
(pip install --no-build-isolation -e .) in training yamls.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
.github/workflows/build-and-commit.yml
DELETED
|
@@ -1,120 +0,0 @@
|
|
| 1 |
-
name: Nix build and commit
|
| 2 |
-
|
| 3 |
-
on:
|
| 4 |
-
pull_request:
|
| 5 |
-
types: [opened, synchronize, reopened]
|
| 6 |
-
workflow_dispatch:
|
| 7 |
-
|
| 8 |
-
permissions:
|
| 9 |
-
contents: write
|
| 10 |
-
|
| 11 |
-
jobs:
|
| 12 |
-
check-commit:
|
| 13 |
-
runs-on: ubuntu-latest
|
| 14 |
-
outputs:
|
| 15 |
-
skip: ${{ steps.check.outputs.skip }}
|
| 16 |
-
steps:
|
| 17 |
-
- uses: actions/checkout@v4
|
| 18 |
-
with:
|
| 19 |
-
fetch-depth: 0
|
| 20 |
-
- id: check
|
| 21 |
-
run: |
|
| 22 |
-
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
| 23 |
-
msg=$(git log -1 --pretty=%B "${{ github.event.pull_request.head.sha }}")
|
| 24 |
-
else
|
| 25 |
-
msg="manual dispatch"
|
| 26 |
-
fi
|
| 27 |
-
echo "Commit message: $msg"
|
| 28 |
-
if echo "$msg" | grep -q '\[skip-build\]'; then
|
| 29 |
-
echo "skip=true" >> "$GITHUB_OUTPUT"
|
| 30 |
-
else
|
| 31 |
-
echo "skip=false" >> "$GITHUB_OUTPUT"
|
| 32 |
-
fi
|
| 33 |
-
|
| 34 |
-
build_and_commit:
|
| 35 |
-
needs: check-commit
|
| 36 |
-
if: needs.check-commit.outputs.skip == 'false'
|
| 37 |
-
runs-on: docker-builder-01
|
| 38 |
-
steps:
|
| 39 |
-
- name: Show disk usage
|
| 40 |
-
run: df -h
|
| 41 |
-
|
| 42 |
-
- name: Notify build start on Slack
|
| 43 |
-
id: slack_start
|
| 44 |
-
run: |
|
| 45 |
-
msg="*Build started* for \`${{ github.repository }}\`\nBranch: \`${{ github.ref_name }}\`\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>"
|
| 46 |
-
response=$(curl -s -X POST \
|
| 47 |
-
-H "Authorization: Bearer ${{ secrets.SLACK_TOKEN }}" \
|
| 48 |
-
-H "Content-type: application/json; charset=utf-8" \
|
| 49 |
-
--data "{\"channel\":\"${{ secrets.SLACK_CHANNEL_ID }}\",\"text\":\"$msg\"}" \
|
| 50 |
-
https://slack.com/api/chat.postMessage)
|
| 51 |
-
ts=$(echo "$response" | jq -r '.ts')
|
| 52 |
-
echo "thread_ts=$ts" >> "$GITHUB_OUTPUT"
|
| 53 |
-
echo "$response"
|
| 54 |
-
|
| 55 |
-
- name: Checkout repository
|
| 56 |
-
uses: actions/checkout@v4
|
| 57 |
-
with:
|
| 58 |
-
fetch-depth: 0
|
| 59 |
-
lfs: true
|
| 60 |
-
ref: ${{ github.head_ref || github.ref }}
|
| 61 |
-
|
| 62 |
-
- name: Install Nix
|
| 63 |
-
uses: cachix/install-nix-action@v31
|
| 64 |
-
|
| 65 |
-
- name: Setup huggingface cachix
|
| 66 |
-
uses: cachix/cachix-action@v15
|
| 67 |
-
with:
|
| 68 |
-
name: huggingface
|
| 69 |
-
|
| 70 |
-
- name: Clean build directory
|
| 71 |
-
run: |
|
| 72 |
-
rm -rf build
|
| 73 |
-
|
| 74 |
-
- name: Build with Nix
|
| 75 |
-
run: |
|
| 76 |
-
nix run .#build-and-copy \
|
| 77 |
-
--override-input kernel-builder github:huggingface/kernel-builder \
|
| 78 |
-
--max-jobs 8 \
|
| 79 |
-
-j 8 \
|
| 80 |
-
-L
|
| 81 |
-
|
| 82 |
-
- name: List built binaries
|
| 83 |
-
run: |
|
| 84 |
-
ls build
|
| 85 |
-
|
| 86 |
-
- name: Commit build artifact
|
| 87 |
-
run: |
|
| 88 |
-
git config user.name "github-actions[bot]"
|
| 89 |
-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
| 90 |
-
git add build/*
|
| 91 |
-
git commit -m "Add built binary [skip-build]"
|
| 92 |
-
|
| 93 |
-
- name: Push changes
|
| 94 |
-
run: |
|
| 95 |
-
git push origin HEAD:"$HEAD_REF"
|
| 96 |
-
env:
|
| 97 |
-
HEAD_REF: ${{ github.head_ref || github.ref }}
|
| 98 |
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 99 |
-
|
| 100 |
-
- name: Notify success on Slack (thread)
|
| 101 |
-
if: success()
|
| 102 |
-
run: |
|
| 103 |
-
ts="${{ steps.slack_start.outputs.thread_ts }}"
|
| 104 |
-
msg="*Build succeeded* for \`${{ github.repository }}\`\nBranch: \`${{ github.ref_name }}\`\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>"
|
| 105 |
-
curl -s -X POST \
|
| 106 |
-
-H "Authorization: Bearer ${{ secrets.SLACK_TOKEN }}" \
|
| 107 |
-
-H "Content-type: application/json; charset=utf-8" \
|
| 108 |
-
--data "{\"channel\":\"${{ secrets.SLACK_CHANNEL_ID }}\",\"text\":\"$msg\",\"thread_ts\":\"$ts\"}" \
|
| 109 |
-
https://slack.com/api/chat.postMessage
|
| 110 |
-
|
| 111 |
-
- name: Notify failure on Slack (thread)
|
| 112 |
-
if: failure()
|
| 113 |
-
run: |
|
| 114 |
-
ts="${{ steps.slack_start.outputs.thread_ts }}"
|
| 115 |
-
msg="*Build failed* for \`${{ github.repository }}\`\nBranch: \`${{ github.ref_name }}\`\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Workflow>"
|
| 116 |
-
curl -s -X POST \
|
| 117 |
-
-H "Authorization: Bearer ${{ secrets.SLACK_TOKEN }}" \
|
| 118 |
-
-H "Content-type: application/json; charset=utf-8" \
|
| 119 |
-
--data "{\"channel\":\"${{ secrets.SLACK_CHANNEL_ID }}\",\"text\":\"$msg\",\"thread_ts\":\"$ts\"}" \
|
| 120 |
-
https://slack.com/api/chat.postMessage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|