forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 6
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
CI: initial commit #69
Closed
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
306f4b8
CI: Provided Github Action for kernel
AKuHAK fbfb18d
test
AKuHAK c360ddb
Update compilation.yml
AKuHAK 6ffef9c
Update compilation.yml
AKuHAK 74a6189
Update compilation.yml
AKuHAK 101a1d7
Update compilation.yml
AKuHAK c6a8bc2
Update compilation.yml
AKuHAK 963e422
Update compilation.yml
AKuHAK 65a4a98
Update compilation.yml
AKuHAK d975f53
Update compilation.yml
AKuHAK 315628f
Update compilation.yml
AKuHAK ccd3259
Update compilation.yml
AKuHAK 81795e2
Update compilation.yml
AKuHAK e9304d7
Update compilation.yml
AKuHAK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,52 @@ | ||
name: CI-compile | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: ghcr.io/frno7/mipsr5900el-gentoo-linux-gnu:main | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Compile project | ||
env: | ||
INSTALL_MOD_PATH: ../initramfs/ps2/ | ||
INSTALL_MOD_STRIP: 1 | ||
run: | | ||
mv -f /srv/initramfs ../ | ||
make -j $(getconf _NPROCESSORS_ONLN) ps2_defconfig | ||
make -j $(getconf _NPROCESSORS_ONLN) oldconfig | ||
make -j $(getconf _NPROCESSORS_ONLN) vmlinux | ||
make -j $(getconf _NPROCESSORS_ONLN) modules | ||
make -j $(getconf _NPROCESSORS_ONLN) modules_install | ||
make -j $(getconf _NPROCESSORS_ONLN) vmlinuz | ||
cp vmlinuz PS2Linux-${{ github.ref_name }}-${{ github.sha }}.ELF | ||
|
||
- name: Upload kernel as artifact | ||
if: ${{ success() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: "PS2Linux-${{ github.ref_name }}-${{ github.sha }}.ELF" | ||
path: PS2Linux-${{ github.ref_name }}-${{ github.sha }}.ELF | ||
|
||
- name: Upload initramfs as artifact | ||
if: ${{ success() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Initramfs | ||
path: usr/initramfs_data.cpio* | ||
|
||
- name: Upload kernel as pre-release | ||
if: github.ref == 'refs/heads/ps2-main' | ||
uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: true | ||
automatic_release_tag: "latest" | ||
title: Development build | ||
files: | | ||
PS2Linux-${{ github.ref_name }}-${{ github.sha }}.ELF | ||
usr/initramfs_data.cpio* |
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 |
---|---|---|
|
@@ -91,6 +91,7 @@ modules.order | |
!.gitattributes | ||
!.gitignore | ||
!.mailmap | ||
!.github | ||
|
||
# | ||
# Generated include files | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these steps done in
https://github.com/frno7/mipsr5900el-gentoo-linux-gnu/blob/9e01f44b0d5e04a496c8ac27e13494bf208eb63a/Dockerfile#L49-L55
already? I agree that they're better placed here, but then I suppose we should remove them from the mipsr5900el-gentoo-linux-gnu repo? Does it make sense to make the Dockers more modular, so that QEMU would be built only in the qemu repo, and so on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big philosophical question :D Docker image currently is so unoptimized, that it is almost 3.5Gb in size and 1.7Gb reserved only for kernel sources. I made a Docker image to hold All-In-One inside one container, so everyone can download it and make a fast kernel compilation on his machine just by typing
cd /srv/kernel; make vmlinuz
. As about this Github Action, I agree that it is doing "double work", but I don't see that this is a problem. Docker contains Linux kernel from the past, but Github Action compiles an actively developed branch that can be more actual.Anyway, I don't think that this action should be affected by this. You probably should create an issue in the Docker container repository for possible removing kernel sources from the container.
It can make sense, but it is difficult to calculate necessary dependencies. It is much easier to hold everything inside an all-in-one container than to manage dependency calculations for each repository. This container can be overkill for most repoes, but it is much easier to maintain. And it will be faster to complete cause all utilities are already precompiled inside the container.
Maybe only the kernel itself can be removed from container, cause it is very big and probably will not be dpendent for other things (except of initramfs of course, I mainly included it there for easier intiramfs managing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, let's celebrate this package achievement now, and tune things later as we go along. Will you push the branch name thing mentioned in #69 (comment) before we merge this? With the frno7/gentoo-mipsr5900el@9e01f44 fix in, chances are that it'll actually boot nice and proper. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am outof my pc, will be able to look at itinfew hours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Initialize containers fails with
invalid reference format: repository name must be lowercase
. It seemsgithub.ref
evaluates torefs/heads/ps2-main
, which having/
won’t work as a branch name. We’d need to get rid of therefs/heads/
prefix. A need for a substring function, again. :-)Environment files seems to offer a solution. Adapting its example, something like
where
${GITHUB_REF#refs/*/}
(shortest matching pattern deleted) and${GITHUB_SHA:0:8}
(substring expansion) are Bash parameter expansion rules.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the documentation for
GITHUB_REF
it’sA problematic case will be pull requests with
refs/pull/<pr_number>/merge
having triple/
. We could use${GITHUB_REF##refs/*/}
with##
serving as the longest matching pattern deleted rather than the shortest with a single#
. It’ll evaluaterefs/pull/17/merge
tomerge
, rather than17/merge
, which wouldn’t work with/
. Another, more useful alternative, would be to have FILE_TAG becomepull-17
,17-merge
, orpull-17-merge
. :-)