Skip to content

Commit

Permalink
Merge branch 'feature/ci' into 'trunk'
Browse files Browse the repository at this point in the history
Added GitLab CI

See merge request racepointenergy/linux/meta-swift!13
  • Loading branch information
colemancda committed Oct 19, 2022
2 parents 1cac89e + 6f6522b commit 24732b2
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="ubuntu-20.04"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# Install BitBake dependencies
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev xterm python3-subunit mesa-common-dev zstd liblz4-tool file

20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/ubuntu
{
"name": "Ubuntu",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-20.04" }
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on: [push]

jobs:

build:
name: Build
runs-on: ubuntu-latest
container: colemancda/meta-swift
strategy:
matrix:
machine: [beaglebone-yocto, qemuarm64]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
export SRC_ROOT=$GITHUB_WORKSPACE
export POKY_DIR=/tmp/poky
export MACHINE=${{ matrix.machine }}
cd /tmp/
git clone --branch dunfell-23.0.20-cmake-3.22.3 https://github.com/MillerTechnologyPeru/poky.git
cd $SRC_ROOT
./build.sh
30 changes: 30 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
stages:
- build

build-armv7:
image: colemancda/meta-swift
stage: build
script:
- export SRC_ROOT=$(pwd)
- export MACHINE=beaglebone-yocto
- export POKY_DIR=/tmp/poky
- cd /tmp/
- git clone --branch dunfell-23.0.20-cmake-3.22.3 https://github.com/MillerTechnologyPeru/poky.git
- cd $SRC_ROOT
- ./build.sh
tags:
- bastion-c5d.9xl

build-arm64:
image: colemancda/meta-swift
stage: build
script:
- export SRC_ROOT=$(pwd)
- export MACHINE=qemuarm64
- export POKY_DIR=/tmp/poky
- cd /tmp/
- git clone --branch dunfell-23.0.20-cmake-3.22.3 https://github.com/MillerTechnologyPeru/poky.git
- cd $SRC_ROOT
- ./build.sh
tags:
- bastion-c5d.9xl
23 changes: 23 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e

# Configuration
SRC_ROOT="${SRC_ROOT:=$(pwd)}"
POKY_DIR="${POKY_DIR:=$SRC_ROOT/../poky}"
MACHINE="${MACHINE:=beaglebone-yocto}"

# Build Yocto Poky
cd $POKY_DIR
source oe-init-build-env
bitbake-layers add-layer $SRC_ROOT
# Customize build
touch conf/sanity.conf
CONF_FILE=./conf/local.conf
rm -rf $CONF_FILE
echo "# Swift for Yocto" >> $CONF_FILE
echo "MACHINE=\"${MACHINE}\"" >> $CONF_FILE
#echo 'SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"' >> $CONF_FILE
#echo "USER_CLASSES += \"buildstats buildstats-summary\"" >> $CONF_FILE

# build Swift
bitbake swift-hello-world

0 comments on commit 24732b2

Please sign in to comment.