Skip to content

nvidia: Adjust action and scripts #7

nvidia: Adjust action and scripts

nvidia: Adjust action and scripts #7

Workflow file for this run

name: Build and lint
on:
push:
paths:
- 'linux-cachyos/PKGBUILD'
- '.github/workflows/build.yml'
workflow_dispatch:
env:
CCACHE_DIR: /home/builder/.ccache
jobs:
build:
name: linux-cachyos
strategy:
matrix:
toolchain: [gcc, clang]
runs-on: ubuntu-latest
container: archlinux:base-devel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup build environment
run: |
# Use CachyOS repository
cat << 'EOF' >> /etc/pacman.conf
[cachyos]
Server = https://mirror.cachyos.org/repo/x86_64/cachyos
EOF
pacman-key --init
pacman-key --recv-keys F3B607488DB35A47 --keyserver keyserver.ubuntu.com
pacman-key --lsign-key F3B607488DB35A47
pacman -Syu --noconfirm --needed ccache
# Setup builder user
useradd builder -m
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chmod -R a+rw .
# Use all threads for building
sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j$(nproc) -l$(nproc)"/g' /etc/makepkg.conf
# Setup a packager name to indicate that kernel has built with CI
sed -i 's/#PACKAGER=".*"/PACKAGER="CachyOS GitHub Actions"/g' /etc/makepkg.conf
# Setup ccache
sed -i 's|!ccache|ccache|' /etc/makepkg.conf
sudo -u builder mkdir -p ${{ env.CCACHE_DIR }}
- name: Setup ccache
id: cache
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.toolchain }}-${{ github.run_id }}
restore-keys: |
ccache-${{ matrix.toolchain }}
- name: Build package (${{ matrix.toolchain }})
id: makepkg
env:
_build_zfs: yes
_build_nvidia_open: yes
_use_llvm_lto: ${{ matrix.toolchain == 'gcc' && 'none' || 'thin' }}
run: |
cd "linux-cachyos"
sudo -H -E -u builder makepkg --skipchecksums --syncdeps --noconfirm
- name: Upload package to artifacts
id: upload
uses: actions/upload-artifact@v4
with:
name: linux-cachyos-${{ matrix.toolchain }}
path: linux-cachyos/*.pkg.tar.zst*