Void #1459
Workflow file for this run
This file contains hidden or 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: build | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.run_id || github.head_ref || github.ref }}-${{ github.workflow }}-${{ github.event_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-kernel: | |
| name: build kernel | |
| runs-on: ${{ github.repository_owner == 'commaai' && 'namespace-profile-arm64-8x16-2004-caching' || 'ubuntu-24.04-arm' }} | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| submodules: true | |
| - name: Get kernel submodule ref | |
| id: kernel-submodule | |
| run: echo "ref=$(git ls-tree HEAD | awk '$4 == "agnos-kernel-sdm845"' | awk '{print $3}')" | tee -a $GITHUB_OUTPUT | |
| - name: Restore ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .ccache | |
| key: ccache-kernel-${{ steps.kernel-submodule.outputs.ref }}-${{ github.run_id }} | |
| restore-keys: | | |
| ccache-kernel-${{ steps.kernel-submodule.outputs.ref }}- | |
| ccache-kernel- | |
| - name: Build kernel | |
| env: | |
| CCACHE_DIR: ${{ github.workspace }}/.ccache | |
| CCACHE_MAXSIZE: 5G | |
| run: ./build_kernel.sh | |
| - name: Upload boot image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: boot | |
| path: output/boot.img | |
| build-system: | |
| name: build system | |
| runs-on: ${{ github.repository_owner == 'commaai' && 'namespace-profile-arm64-8x16-2004-caching' || 'ubuntu-24.04-arm' }} | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Build Void system | |
| env: | |
| GIT_HASH: ${{ github.event.pull_request.head.sha }} | |
| run: ./void/build_void.sh | |
| - name: Statistics | |
| id: stats | |
| run: | | |
| { | |
| echo 'stats_summary<<EOF' | |
| scripts/analyze-agnos-rootfs.sh | |
| echo EOF | |
| } | tee -a $GITHUB_OUTPUT | |
| - name: Upload system image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: system | |
| path: output/system.img | |
| - name: Save stats | |
| run: echo "${{ steps.stats.outputs.stats_summary }}" > output/stats.txt | |
| - name: Upload stats | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: stats | |
| path: output/stats.txt | |
| package: | |
| name: package OTA | |
| needs: [build-kernel, build-system] | |
| if: "contains(needs.build-system.result, 'success')" | |
| runs-on: ${{ github.repository_owner == 'commaai' && 'namespace-profile-arm64-8x16-2004-caching' || 'ubuntu-24.04-arm' }} | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Get commit message | |
| run: | | |
| { | |
| echo 'LAST_COMMIT_MESSAGE<<EOF' | |
| if [ "${{ github.event_name }}" == "push" ]; then | |
| echo "${{ github.event.head_commit.message }}" | |
| elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.sha }}|") | |
| echo "$(curl -s "$COMMIT_URL" | jq -r '.commit.message')" | |
| elif [ "${{ github.event_name }}" == "pull_request" ]; then | |
| PR_COMMIT_URL=$(echo "${{ github.event.repository.commits_url }}" | sed "s|{/sha}|/${{ github.event.pull_request.head.sha }}|") | |
| echo "$(curl -s "$PR_COMMIT_URL" | jq -r '.commit.message')" | |
| fi | |
| echo EOF | |
| } | tee -a $GITHUB_ENV | |
| - name: Download boot image | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: boot | |
| path: output | |
| - name: Download system image | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: system | |
| path: output | |
| - name: Download stats | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: stats | |
| path: output | |
| - name: Package and OTA push | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| env: | |
| AGNOS_UPDATE_URL: https://gitlab.com/commaai/ci-artifacts/-/raw/agnos-builder/pr-${{ github.event.number }} | |
| run: | | |
| scripts/package_ota.py | |
| - name: Save PR number, VERSION and stats | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| run: | | |
| echo ${{ github.event.number }} > output/ota/PR | |
| cp VERSION output/ota | |
| cp output/stats.txt output/ota/agnos_stats.txt | |
| - name: Upload artifacts | |
| if: "contains(env.LAST_COMMIT_MESSAGE, '[upload]')" | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agnos-artifacts | |
| path: output/ota | |
| compression-level: 0 |