[Meta] Ensure caller-provided environment always takes precedence whe… #626
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: axle CI | |
# Configure when the workflow runs | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [ master, uefi-bootloader, build-in-ci, rust-support, paging-demo ] | |
pull_request: | |
branches: [ master, uefi-bootloader, build-in-ci, rust-support, paging-demo ] | |
# Allows running the workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out repo at $GITHUB_WORKSPACE | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
# Requires Python >= 3.9 for str.removesuffix() | |
python-version: '3.9' | |
# https://github.com/actions/setup-python#caching-packages-dependencies | |
# cache: 'pip' | |
# cache-dependency-path: 'python-dependencies.txt' | |
- run: pip install -r python-dependencies.txt | |
- name: Cache libc and toolchain | |
# https://github.com/nektos/act/issues/285 | |
if: ${{ !env.ACT }} | |
id: build-libc-and-toolchain | |
uses: actions/cache@v2 | |
with: | |
path: | | |
x86_64-toolchain | |
axle-sysroot | |
scripts/mkinitrd/target | |
key: libc-and-toolchain-cachebuster | |
- name: Build libc and toolchain | |
shell: bash | |
if: steps.build-libc-and-toolchain.outputs.cache-hit != 'true' | |
run: | | |
python3 scripts/install_dependencies.py | |
python3 scripts/build_os_toolchain.py | |
echo "Toolchain built successfully" | |
- name: Build Rust toolchain | |
shell: bash | |
run: | | |
# Build kernel headers as libutils depends on these | |
# python3 scripts/build_kernel_headers.py | |
# We need to build libutils, since the rust libc links against it | |
# python3 scripts/build_meson_projects.py --only_build libutils | |
python3 scripts/build_rust_toolchain.py --rebuild_libc | |
python3 scripts/build_rust_toolchain.py --rebuild_libcore_for_kernel_libs | |
- name: Build OS image | |
shell: bash | |
run: | | |
git submodule update --init --recursive | |
# PT: For nasm in CI | |
python3 scripts/install_dependencies.py | |
# Build userspace headers as the kernel depends on file_manager definitions | |
python3 scripts/build_userspace_headers.py | |
# Finally, compile the kernel and build the OS image | |
python3 scripts/build_os_image.py --no_run | |
# Run Rust tests | |
python3 scripts/build_rust_toolchain.py --test | |
- name: Update nightly release | |
uses: swift-project/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: nightly-${{ github.sha }} | |
files: axle.iso | |
allow_override: true | |
prerelease: false | |
commitish: ${{ github.sha }} | |
gzip: false |