image: rust:latest

stages:
  - build
  - test

build:
  stage: build
  script:
    - cargo build
  artifacts:
    paths:
      - target
    expire_in: 24h

test:
  stage: test
  before_script:
    - mkdir bin
    - curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ./bin
  script:
    - bin/cargo-nextest nextest run 
    - cargo run --bin stories -- tests/test_stories.yaml
  artifacts:
    when: always
    reports:
      junit:
        - target/nextest/default/junit.xml
        - reports/junit.xml
