Skip to content
Snippets Groups Projects
Forked from Dragoon / Komodo
111 commits behind the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 1016 B
image: "rust:latest"

stages:
  - fmt
  - test

variables:
  NUSHELL_ARCH: "x86_64-unknown-linux-musl"
  NUSHELL_VERSION: "0.91.0"

workflow:
  rules:
    - if: $CI_COMMIT_MESSAGE =~ /^(draft|no-ci):/
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
      when: never
    - if: ($CI_PIPELINE_SOURCE == "push") && ($CI_COMMIT_BRANCH == "main")

fmt:
  stage: fmt

  script:
    - make fmt-check

test:
  stage: test
  needs:
    - fmt
  before_script:
    - apt update --yes
    - apt upgrade --yes
    - apt install protobuf-compiler --yes

    - export NUSHELL_BUILD="nu-$NUSHELL_VERSION-$NUSHELL_ARCH"
    - export PATH="/tmp/:$PATH"

    # install Nushell
    - curl -fLo /tmp/nu.tar.gz "https://github.com/nushell/nushell/releases/download/$NUSHELL_VERSION/$NUSHELL_BUILD.tar.gz"
    - tar xvf /tmp/nu.tar.gz --directory /tmp
    - cp "/tmp/$NUSHELL_BUILD/nu" /tmp/nu

    - make show

  script:
    - make check clippy test example