.gitlab-ci.yml 1.21 KB
Newer Older
Florian Blasius's avatar
Florian Blasius committed
1 2
image: 'rust:latest'

Florian Blasius's avatar
Florian Blasius committed
3 4 5 6
stages:
    - build
    - test

Florian Blasius's avatar
Florian Blasius committed
7 8 9 10 11 12
variables:
    CARGO_HOME: $CI_PROJECT_DIR/cargo
before_script:
  - apt-get update -qq
  - apt-get install -qq build-essential curl git

13 14
build:linux:
  stage: build
Florian Blasius's avatar
Florian Blasius committed
15 16
  before_script:
    - apt-get update && apt-get -y install cmake
Florian Blasius's avatar
Florian Blasius committed
17 18 19 20 21 22 23
  script:
    - cargo build
  cache:
    paths:
      - cargo/
      - target/

24 25
build:redox:
  stage: build
Florian Blasius's avatar
Florian Blasius committed
26 27 28 29 30 31 32 33
  variables:
    CC: "x86_64-unknown-redox-gcc"
  before_script:
    - apt-get update -qq
    - apt-get install -qq build-essential curl git gnupg software-properties-common apt-transport-https
    - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F
    - add-apt-repository 'deb https://static.redox-os.org/toolchain/apt /'
    - apt-get update -qq && apt-get install -qq x86-64-unknown-redox-gcc
Florian Blasius's avatar
Florian Blasius committed
34
    - rustup default nightly
Florian Blasius's avatar
Florian Blasius committed
35 36 37 38 39 40 41
    - rustup target add x86_64-unknown-redox
  script:
    - cargo build --target x86_64-unknown-redox
  cache:
    paths:
      - cargo/
      - target/
42 43 44

test:linux:
    stage: test
Florian Blasius's avatar
Florian Blasius committed
45 46
    before_script:
    - apt-get update && apt-get -y install cmake
Florian Blasius's avatar
Florian Blasius committed
47
    - apt-get install libsdl2-dev -y
48 49 50
    dependencies:
        - build:linux
    script:
Florian Blasius's avatar
Florian Blasius committed
51
      - rustup default nightly
Florian Blasius's avatar
Florian Blasius committed
52
      - cargo test