-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2d1b97
commit 0026e41
Showing
8 changed files
with
171 additions
and
307 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -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/[email protected] | ||
with: | ||
submodules: true | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install nightly toolchain | ||
uses: actions-rs/[email protected] | ||
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/[email protected] | ||
with: | ||
submodules: true | ||
|
||
- name: Install nightly toolchain | ||
uses: actions-rs/[email protected] | ||
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 |
Oops, something went wrong.