image-watcher 0.0.21

A simple CLI tool.
image: "rust:latest"


stages:
  - check
  - test
  - deploy-examples
  - publish
  - post-run


clean-code:
  stage: check
  script:
    - rustup default nightly
    - rustup component add rustfmt-preview
    - cargo fmt --all -- --check
  allow_failure: true

check:
  stage: check
  script:
    - rustup default nightly
    - cargo check


unittests:
  stage: test
  script:
    - rustup default nightly
    - cargo test --release

benchmarktests:
  stage: test
  script:
    - rustup default nightly
    - cargo bench


linux-optimized:
  stage: deploy-examples
  script:
    - rustup default nightly
    - cargo build --release
    - rm -r -f files
    - mkdir files
    - cp target/release/image-watcher files
  when: on_success
  artifacts:
    paths:
      - files
    expire_in: 2 weeks

windows-optimized:
  stage: deploy-examples
  script:
    - rustup default nightly
    - apt-get update
    - apt-get install gcc -y
    - apt-get install gcc-mingw-w64-x86-64 -y
    - rustup component add rust-std --target=x86_64-pc-windows-gnu
    - mkdir .cargo
    - touch .cargo/config
    - echo [target.x86_64-pc-windows-gnu] >> .cargo/config
    - echo     linker = \"x86_64-w64-mingw32-gcc\" >> .cargo/config
    - echo     ar = \"x86_64-w64-mingw32-gcc-ar\" >> .cargo/config
    - cargo build --release --target=x86_64-pc-windows-gnu
    - rm -r -f files
    - mkdir files
    - cp target/x86_64-pc-windows-gnu/release/image-watcher.exe files
  when: on_success
  artifacts:
    paths:
      - files
    expire_in: 2 weeks


cratesio:
  stage: publish
  script:
    - rustup default nightly
    - rm -r -f files
    - cargo login $CARGO_LOGIN
    - cargo package
    - cargo publish
  when: on_success
  only:
    refs:
      - stable
  allow_failure: true


clippy:
  stage: post-run
  script:
    - rustup default nightly
    - rustup component add clippy-preview
    - cargo clippy
  allow_failure: true