-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): setup github actions and workflows
setup CI/CD for kernel development - added CodeQL for code scanning - every pr is built as an image and is available for 30days on https://oklinux.dev - tagged and released on github for now Signed-off-by: sevki <s@sevki.io>
- Loading branch information
Showing
20 changed files
with
579 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '44 8 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
# Runner size impacts CodeQL analysis time. To learn more, please see: | ||
# - https://gh.io/recommended-hardware-resources-for-running-codeql | ||
# - https://gh.io/supported-runners-and-hardware-resources | ||
# - https://gh.io/using-larger-runners | ||
# Consider using larger runners for possible analysis time improvements. | ||
runs-on: 'ubuntu-latest' | ||
container: | ||
image: debian:latest | ||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'c-cpp' ] | ||
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] | ||
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both | ||
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Set up okLinux development environment | ||
run: | | ||
./deps | ||
cd kernel | ||
export CHROMEOS_KERNEL_FAMILY=termina | ||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
# queries: security-extended,security-and-quality | ||
|
||
|
||
- name: Prepare kernel configuration | ||
run: make olddefconfig | ||
|
||
- name: Build kernel image | ||
run: make -j$(nproc) bzImage | ||
- name: clean up space | ||
run: | | ||
cd ../ | ||
apt-get remove \ | ||
bc \ | ||
bison \ | ||
build-essential \ | ||
clang \ | ||
cloud-image-utils \ | ||
expect \ | ||
flex \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
gh \ | ||
jq \ | ||
libavcodec-dev \ | ||
libavutil-dev \ | ||
libcap-dev \ | ||
libclang-dev \ | ||
libdbus-1-dev \ | ||
libdrm-dev \ | ||
libepoxy-dev \ | ||
libelf-dev \ | ||
libglib2.0-dev \ | ||
libguestfs-tools \ | ||
libslirp-dev \ | ||
libssl-dev \ | ||
libswscale-dev \ | ||
libva-dev \ | ||
libxext-dev \ | ||
lld \ | ||
make \ | ||
meson \ | ||
mypy \ | ||
nasm \ | ||
ncat \ | ||
ninja-build \ | ||
openssh-client \ | ||
pkg-config \ | ||
protobuf-compiler \ | ||
qemu-system-x86 \ | ||
rsync \ | ||
screen \ | ||
strace \ | ||
tmux -y | ||
apt-get clean -y && apt-get autoremove -y && apt-get autoclean -y | ||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# If the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
name: Build Kernel Image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up okLinux environment | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
./deps | ||
cd kernel | ||
export CHROMEOS_KERNEL_FAMILY=termina | ||
- name: Prepare kernel configuration | ||
run: make olddefconfig | ||
- name: Build kernel image | ||
run: make -j$(nproc) bzImage | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: x86_64 | ||
path: arch/x86_64 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy static content to Pages | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Setup okLinux environment | ||
run: | | ||
./docdeps | ||
/usr/bin/python3 -m venv sphinx | ||
. sphinx/bin/activate | ||
pip install -r ./Documentation/sphinx/requirements.txt | ||
make htmldocs | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: './Documentation/output' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build PR | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build_kernel: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up okLinux environment | ||
run: | | ||
./deps | ||
cd kernel | ||
export CHROMEOS_KERNEL_FAMILY=termina | ||
- name: Prepare kernel configuration | ||
run: make olddefconfig | ||
|
||
- name: Build kernel image | ||
run: make -j$(nproc) bzImage | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: x86_64 | ||
path: arch/x86_64 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: bzImage | ||
path: arch/x86_64/boot/bzImage | ||
build_kernel_docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
- name: Setup okLinux environment | ||
run: | | ||
./docdeps | ||
/usr/bin/python3 -m venv sphinx | ||
. sphinx/bin/activate | ||
pip install -r ./Documentation/sphinx/requirements.txt | ||
make htmldocs | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: './Documentation/output' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Propose Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- uses: google-github-actions/release-please-action@v4 | ||
id: release | ||
with: | ||
release-type: simple |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish Image | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up okLinux environment | ||
if: ${{ steps.release.outputs.release_created }} | ||
run: | | ||
./deps | ||
cd kernel | ||
export CHROMEOS_KERNEL_FAMILY=termina | ||
- name: Prepare kernel configuration | ||
run: make olddefconfig | ||
- name: Build kernel image | ||
run: make -j$(nproc) bzImage | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: x86_64 | ||
path: arch/x86_64 | ||
- name: Upload Release Artifact | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release upload ${{ steps.release.outputs.tag_name }} ./arch/x86_64/boot/bzImage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,7 @@ modules.order | |
!.kunitconfig | ||
!.mailmap | ||
!.rustfmt.toml | ||
!.github | ||
|
||
# | ||
# Generated include files | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "6.6.22" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# jinja2>=3.1 is not compatible with Sphinx<4.0 | ||
jinja2<3.1 | ||
Sphinx==2.4.4 | ||
jinja2==3.1.3 | ||
Sphinx==7.2.6 |
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
Oops, something went wrong.