Skip to content

Commit

Permalink
Add travis cia for openrisc kernel
Browse files Browse the repository at this point in the history
This should not go upstream.  Just keep in openrisc repos.

Changes since v1
 - add libelf for x86 build failure

Changes since v2
 - fix .gitignore conflict
 - update gcc toolchain to 9.0.0

Changes since v3
 - fix conflict in .gitconfig
 - update image to bionic
 - fixup mpfr with a ln hack, needed by or1k toolchain

Changes since v4
 - convert from travis to github CI

Changes since v5
 - Update to use latest ubuntu
 - Use embecosm toolchain
  • Loading branch information
stffrdhrn committed Jul 7, 2023
1 parent 10f061c commit ef0bf45
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci

on: [push, pull_request, workflow_dispatch]

jobs:
kernel-builds:
runs-on: ubuntu-latest
env:
LD_LIBRARY_PATH: "/tmp/tools/lib"
CONFIG: ${{ matrix.env.CONFIG }}
ARCH: ${{ matrix.env.ARCH }}
CROSS_COMPILE: ${{ matrix.env.CROSS_COMPILE }}
steps:
# Checkout Repository
- name: Checkout
uses: actions/checkout@v2

# Install OS Tools
- name: Install Tools
run: |
sudo apt-get install build-essential bc xz-utils git iverilog libelf-dev
# Install Toolchain
- name: Install Toolchain
run: |
mkdir -p /tmp/tools
cd /tmp/tools
curl --remote-name --location \
https://buildbot.embecosm.com/job/or1k-gcc-ubuntu2204-release/5/artifact/or1k-embecosm-ubuntu2204-gcc13.1.0.tar.gz
tar -xf or1k-embecosm-ubuntu2204-gcc13.1.0.tar.gz
export PATH=$PATH:/tmp/tools/or1k-embecosm-ubuntu2204-gcc13.1.0/bin
or1k-elf-gcc --version
- name: Run Build
shell: bash {0}
run: |
export PATH=$PATH:/tmp/tools/or1k-embecosm-ubuntu2204-gcc13.1.0/bin
make ARCH=$ARCH $CONFIG && make ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE -j$(($(nproc) + 1))
strategy:
matrix:
env:
- { ARCH: "openrisc", CONFIG: "defconfig", CROSS_COMPILE: "or1k-elf-" }
- { ARCH: "openrisc", CONFIG: "allnoconfig", CROSS_COMPILE: "or1k-elf-" }
- { ARCH: "openrisc", CONFIG: "alldefconfig", CROSS_COMPILE: "or1k-elf-" }
- { ARCH: "x86", CONFIG: "defconfig", CROSS_COMPILE: "" }
# fails with ./usr/include/linux/if.h:28:10: fatal error: sys/socket.h:
# No such file or directory
#- { ARCH: "openrisc", CONFIG: "allyesconfig", CROSS_COMPILE: "or1k-elf-" }
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ modules.order
!.cocciconfig
!.get_maintainer.ignore
!.gitattributes
!.github/
!.gitignore
!.kunitconfig
!.mailmap
!.rustfmt.toml
!.travis.yml

#
# Generated include files
Expand Down
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dist: bionic # bionic needed for gcc 7.4 retpoline
sudo: false
language: c
branches:
- travis
addons:
apt:
sources:
- ubuntu-toolchain-r-test # get gcc-6
packages:
- build-essential
- bc # basic for linux build
- libmpc3 # needed for or1k-linux- toolchain
- libelf-dev
env:
matrix:
- ARCH=openrisc CONFIG=defconfig CROSS_COMPILE=or1k-linux-
- ARCH=openrisc CONFIG=allnoconfig CROSS_COMPILE=or1k-linux-
- ARCH=openrisc CONFIG=allyesconfig CROSS_COMPILE=or1k-linux-
- ARCH=openrisc CONFIG=alldefconfig CROSS_COMPILE=or1k-linux-
- ARCH=x86 CONFIG=defconfig
before_install:
- wget https://github.com/stffrdhrn/gcc/releases/download/or1k-9.0.0-20180613/or1k-linux-9.0.0-20180612.tar.xz -O /tmp/gcc.tar.xz
- tar -xf /tmp/gcc.tar.xz
- sudo ln -s /usr/lib/x86_64-linux-gnu/libmpfr.so.6 /usr/lib/x86_64-linux-gnu/libmpfr.so.4 # because or1k toolchain needs old mpfr
- export PATH=$PATH:$PWD/or1k-linux/bin
script: make $CONFIG && make -j2
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# OpenRISC Linux CI build branch

This branch just has the github ci commits on top of the main
branch.

Its a bit of a hack but we dont want travis files to get into
upstream so I thought this way is good. If there is a better
way let me know.

To update latest code:

```
git checkout travis
git rebase -i for-next
git push origin travis
```

0 comments on commit ef0bf45

Please sign in to comment.