Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
georglauterbach committed Nov 9, 2023
1 parent d2d1b97 commit 0026e41
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 307 deletions.
174 changes: 0 additions & 174 deletions .github/scripts/documentation.sh

This file was deleted.

60 changes: 60 additions & 0 deletions .github/scripts/install_rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#! /usr/bin/env bash

# version 0.2.0
# executed by during CI
# task installs Rust

set -eE -u -o pipefail
shopt -s inherit_errexit

function exit_with_error() {
echo "${1}" >&2
exit 1
}

function usage() {
local BOLD=$(echo -e '\e[1m')
local UNDERLINED=$(echo -e '\e[4m')
local RESET=$(echo -e '\e[0m')
echo -e "Build or serve the documentation
${BOLD}${UNDERLINED}Usage:${RESET} .github/scripts/documentation.sh <COMMAND>
${BOLD}${UNDERLINED}Commands:${RESET}
build Build the documentation (create HTML/CSS/JS)
update_versions_json (CI only) update a special versioning file
serve Serve locally under 'http://127.0.0.1:8080'
"
}

function parse_options_and_arguments() {
RUSTUP_PARAMETERS=('--quiet' '-y' '--default-toolchain' 'none' '--profile' 'minimal' '--no-update-default-toolchain')

while [[ ${#} -gt 0 ]]; do
case "${1}" in
( '--rustup-parameters' )
[[ -n ${2:-} ]] || exit_with_error "No parameters provided after '--additional-rustup-parameters' option"
readarray -t -d ' ' RUSTUP_PARAMETERS <<< "${2:-}"
;;

( * )
usage
exit_with_error "Unknown option(s) '${1}' ${2:+"and '${2}'"}"
;;
esac

shift 2
done
}

function install_rust() {
curl -sSfL 'https://sh.rustup.rs' | sh -s -- "${RUSTUP_PARAMETERS[@]}"

rustup --version
cargo version
rustc --version
}

parse_options_and_arguments "${@}"
install_rust
28 changes: 0 additions & 28 deletions .github/workflows/check_documentation.yml

This file was deleted.

65 changes: 21 additions & 44 deletions .github/workflows/code_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,46 @@ on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
paths:
- .github/workflows/kernel-tests.yml
- kernel/**
- .github/workflows/code_tests.yml
- code/**
branches: ['**']
push:
paths: [kernel/**]
paths: [code/**]
branches: [master]

defaults:
run:
shell: bash
working-directory: code

jobs:
linting:
kernel-linting:
name: Lint the kernel code
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2.4.0
with:
submodules: true
uses: actions/checkout@v4

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly-2022-02-12
override: true
components: rustfmt, clippy
- name: Install Rust
run: ../.github/scripts/install_rust.sh

- name: Install Rustup Components
run: rustup component add rust-src llvm-tools-preview

- name: Run all kernel-related checks
- name: Run all checks
run: >-
source scripts/init.sh
&& cargo run --quiet --package helper -- check --is-ci -vv
cargo run -- -vv check
unit-and-integration-tests:
name: Run all unit- and integration-tests
runs-on: ubuntu-20.04
name: Run unit- and integration-tests
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2.4.0
with:
submodules: true

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly-2022-02-12
override: true
uses: actions/checkout@v4

- name: Install Rustup Components
run: rustup component add rust-src llvm-tools-preview
- name: Install Rust
run: ../.github/scripts/install_rust.sh

- name: Install QEMU
run: sudo apt update && sudo apt install qemu-system-x86

- name: Print QEMU version
run: qemu-system-x86_64 --version
- name: Run all unit-test
run: >-
cargo run -- -vv u-test
- name: Run `cargo test`
- name: Run all integration-tests
run: >-
source scripts/init.sh
&& cargo run --quiet --package helper -- test --is-ci -vv
cargo run -- -vv u-test
Loading

0 comments on commit 0026e41

Please sign in to comment.