summaryrefslogtreecommitdiffstats
path: root/.builds/rust.yml
blob: d7cceb72e5256e5349bfcfca4cd07689ad8d63aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
image: ubuntu/focal

packages:
  - pkg-config
  - libssl-dev

sources:
  - https://git.sr.ht/~a14m/game-of-life

tasks:
  - install: |
      curl https://sh.rustup.rs -sSf | sh -s -- -y
      source $HOME/.cargo/env
      rustup install nightly

  - test: |
      source $HOME/.cargo/env
      cd game-of-life/CLI/rust
      cargo +nightly test

  - lint: |
      source $HOME/.cargo/env
      cd game-of-life/CLI/rust
      cargo fmt -- --check

  - release: |
      set +x
      cd game-of-life/CLI/rust
      REF=`git describe --exact-match --tags HEAD ||:`
      if [[ ! `echo $REF | awk '/^rust\/v.*$/'` ]]; then
        echo "Skipping release step. no matching tag"
        exit 0
      fi
      echo "Publishing release $REF"
      source $HOME/.cargo/env
      cargo build --release