Update toolchain cmake from v3.29.0 to v3.29.4. #275
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-env: | |
name: Prepare build environment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Free up some space on the rootfs | |
run: | | |
sudo rm -rf /usr/share/rust | |
sudo rm -rf /usr/share/swift | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /usr/local/share/boost | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Update containers | |
run: ./docker/update-images | |
- name: Remove unpruned images | |
run: | | |
docker system prune -f | |
docker images -q ghcr.io/griwes/reaveros-build-env/unpruned | xargs docker rmi -f | |
- name: Save the pruned image | |
run: docker save ghcr.io/griwes/reaveros-build-env:${{ github.sha }} | gzip > docker.tar.gz | |
- name: Save the pruned image as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-env | |
path: ./docker.tar.gz | |
retention-days: 3 | |
build-deps-check: | |
name: Check build system dependencies | |
runs-on: ubuntu-latest | |
needs: build-env | |
strategy: | |
matrix: | |
arch: | |
- amd64 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Download build-env | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-env | |
path: artifacts | |
- name: Import docker image | |
run: docker load --input artifacts/docker.tar.gz | |
- name: Verify dependencies of all install targets | |
run: | | |
docker run -v $(pwd):/reaveros ghcr.io/griwes/reaveros-build-env:${{ github.sha }} bash -c ' | |
set -e | |
set -o pipefail | |
cd /build | |
cmake . | |
for target in $(make help | grep -- -${{ matrix.arch }}$ | grep -v all | sed "s/\.\.\. //") | |
do | |
rm -rf install/{images,kernels,loaders,sysroots,userspace} | |
make ${target} -j$(nproc) | |
done | |
' | |
image-build: | |
name: Build OS image | |
runs-on: ubuntu-latest | |
needs: build-env | |
strategy: | |
matrix: | |
image: | |
- uefi-efipart-amd64 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Download build-env | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-env | |
path: artifacts | |
- name: Import docker image | |
run: docker load --input artifacts/docker.tar.gz | |
- name: Build requested image | |
run: | | |
docker run -v $(pwd):/reaveros ghcr.io/griwes/reaveros-build-env:${{ github.sha }} bash -c ' | |
set -e | |
cd /build | |
make image-${{ matrix.image }} -j$(nproc) | |
cp install/images/${{ matrix.image }}.img /reaveros/artifacts | |
' | |
- name: Save the built image as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: image-${{ matrix.image }} | |
path: artifacts/${{ matrix.image }}.img | |
unit-tests: | |
name: Build and run unit tests | |
runs-on: ubuntu-latest | |
needs: build-env | |
strategy: | |
matrix: | |
arch: | |
- amd64 | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v3 | |
- name: Download build-env | |
uses: actions/download-artifact@v3 | |
with: | |
name: build-env | |
path: artifacts | |
- name: Import docker image | |
run: docker load --input artifacts/docker.tar.gz | |
- name: Build and run unit tests | |
run: | | |
docker run -v $(pwd):/reaveros ghcr.io/griwes/reaveros-build-env:${{ github.sha }} bash -c ' | |
set -e | |
cd /build | |
make all-${{ matrix.arch }}-build-tests -j$(nproc) | |
ctest -j$(nproc) | |
' | |
automerge: | |
name: Auto-merge if PR is automatic | |
runs-on: ubuntu-latest | |
needs: [build-deps-check, image-build, unit-tests] | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Merge the PR if automatic | |
run: | | |
set -e | |
url=$(jq -r '.pull_request.url' "${GITHUB_EVENT_PATH}") | |
sha=$(jq -r '.pull_request.head.sha' "${GITHUB_EVENT_PATH}") | |
if curl "${url}" | jq -r '.labels[].name' | egrep -q '^automatic:' | |
then | |
curl \ | |
-X PUT \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \ | |
"${url}/merge" \ | |
-d "{ \"merge_method\": \"rebase\", \"sha\": \"${sha}\"}" | |
fi | |