osbuilder 0.3.0

OS-agnostic builder for building custom OS
Documentation
stages:
  - cargotest
  - junit
  - release
  - sast
  - renovate
image: rust:latest
variables:
  GIT_SUBMODULE_STRATEGY: recursive
before_script:
  - apt-get update -yqq;
  - apt-get install -yqq --no-install-recommends build-essential clang git

test:cargo:
  stage: cargotest
  script:
    - rustup default nightly
    - rustc --version && cargo --version
    - cargo test --verbose
test:junit-report:
  stage: junit
  script:
    - rustup default nightly
    - cargo install junitify
    - cargo test -- --format=json -Z unstable-options --report-time | junitify --out
      $CI_PROJECT_DIR/tests/
  artifacts:
    when: always
    reports:
      junit: "$CI_PROJECT_DIR/tests/*.xml"

sast:
  stage: sast
include:
  - template: Security/SAST.gitlab-ci.yml
cov:  
  stage: sast
  variables:
    # Set an environment variable which causes LLVM to write coverage data to the specified location. This is arbitrary, but the path passed to grcov (the first argument) must contain these files or the coverage data won't be noticed.
    LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
  script:
    - cargo install grcov
    - cargo build --workspace
    # Run all your Rust-based tests
    - cargo test --workspace
    # Create the output directory
    - mkdir target/coverage
    # This is a multi-line command. You can also write it all as one line if desired, just remove
    # the '|' and all the newlines.
    - |
        grcov \
        target/coverage \
        --binary-path target/debug \
        -s . \
        -o target/coverage \
        --keep-only 'src/*' \
        --output-types html,cobertura 
  coverage: '/Coverage: \d+(?:\.\d+)?/'
  artifacts:
    paths:
      - target/coverage/
    reports:
      coverage_report:
        coverage_format: cobertura
        path: target/coverage.xml
  allow_failure: true