Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup build GH action #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E sed -i~orig -e 's/# deb-src/deb-src/' /etc/apt/sources.list
sudo -E apt-get -qq update
sudo -E apt-get -qq install build-essential wget -y
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean

- name: Checkout the module
uses: actions/checkout@v2
with:
path: module

- name: Checkout the kernel
uses: actions/checkout@v2
with:
repository: torvalds/linux
path: kernel
ref: v5.4
Comment on lines +33 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to follow linux stable x5.4.y and not just the initial 5.4 release?

I wonder about the efficiency of this. I looks like actions/checkout does a shallow clone, so at least that isn't cloning the whole linux repo. The other option would be to install the kernel-devel ubuntu equivalent and compile against that. However, that would be whatever ubuntu is shipping. Maybe 5.4 to match OpenXT is better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you can clone a non-github repo using the repository directive, and I think the stable-5.4.y is off of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Yea I think explicitly matching the openxt kernel version is a good idea.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @crogers1 states, I do not believe I can pull an external repository. I can look into it to see.

As for building against Ubuntu, the purpose was to validate that the driver builds against a vanilla kernel and I selected the version for which OpenXT is currently using. It is possible to add additional tasks that build against other trees.


- name: Prepare the kernel
working-directory: ./kernel
run: |
wget -O .config https://raw.githubusercontent.com/OpenXT/xenclient-oe/master/recipes-kernel/linux/5.4/defconfigs/xenclient-dom0/defconfig
make olddefconfig
make -j$(nproc) modules_prepare

- name: Compile the module
working-directory: ./module/argo-linux
env:
KERNEL_SRC: ${{ github.workspace }}/kernel
run: make