ci: Add GitHub Actions #1
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
# SPDX-License-Identifier: CC0-1.0 | |
# SPDX-FileCopyrightText: NONE | |
name: CI | |
on: | |
push: | |
branches-ignore: | |
- 'wip/*' | |
pull_request: | |
env: | |
XGCC_DIR: "/opt/xgcc" | |
XGCCPATH: "/opt/xgcc/bin" | |
jobs: | |
toolchain: | |
runs-on: ubuntu-24.04 | |
timeout-minutes: 60 | |
outputs: | |
models: ${{ steps.model-matrix.outputs.models }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Get coreboot toolchain | |
id: get_coreboot_toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.XGCC_DIR }} | |
key: coreboot-${{ runner.os }}-${{ hashFiles('coreboot/util/crossgcc/sum/*') }} | |
- name: Build coreboot toolchain | |
if: steps.get_coreboot_toolchain.outputs.cache-hit != 'true' | |
run: ./scripts/coreboot-sdk.sh DEST=$XGCC_DIR | |
- name: Generate model matrix | |
id: model-matrix | |
run: | | |
FIRMWARE_MODELS=$(find models/ -maxdepth 1 -mindepth 1 -type d -printf "%f\n" | jq -sRc 'split("\n")[:-1]') | |
echo "models=$FIRMWARE_MODELS" >> $GITHUB_OUTPUT | |
build: | |
runs-on: ubuntu-24.04 | |
needs: toolchain | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
model: ${{ fromJSON(needs.toolchain.outputs.models) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
submodules: recursive | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Fix coreboot submodules | |
working-directory: ./coreboot | |
run: git submodule update --init --checkout --recursive --force | |
- name: Get coreboot toolchain | |
id: get_coreboot_toolchain | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.XGCC_DIR }} | |
key: coreboot-${{ runner.os }}-${{ hashFiles('coreboot/util/crossgcc/sum/*') }} | |
- name: Install deps | |
run: | | |
./scripts/install-deps.sh | |
./scripts/install-rust.sh | |
pushd ec; ./scripts/deps.sh; popd | |
- name: Build firmware | |
run: ./scripts/build.sh "${{ matrix.model }}" | |
- name: Upload artifacts | |
if: github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.model }}-${{ github.sha }} | |
path: build/ |