Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.4 KiB
Newer Older
  • Learn to ignore specific revisions
  • image: hivesolutions/ubuntu_dev
    
    
    variables:
      NETLIFY_SITE_ID: chip-ahoyto
    
    
    stages:
      - build
    
    
    before_script:
    
      - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q pkg-config nodejs npm
    
      - curl -sf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y
      - export PATH=$PATH:$HOME/.cargo/bin
    
    build-rust:
      stage: build
      parallel:
        matrix:
    
          - RUST_VERSION: ["1.56.1", "1.60.0", "stable", "nightly"]
    
      script:
        - rustup toolchain install $RUST_VERSION
        - rustup override set $RUST_VERSION
        - rustc --version
        - cargo build
        - cargo build --release
    
    
    build-wasm:
      stage: build
      parallel:
        matrix:
          - RUST_VERSION: ["1.60.0"]
      script:
        - rustup toolchain install $RUST_VERSION
        - rustup override set $RUST_VERSION
        - rustc --version
        - cargo install wasm-pack
        - wasm-pack build --release --target=web --out-dir=examples/web/lib -- --features wasm
    
        - cd examples/web && npm install && npm run build && rm -rf node_modules package-lock.json
    
      artifacts:
        paths:
          - examples/web
    
    
    deploy-netlify-preview:
      stage: deploy
      script:
        - npm install netlify-cli -g
        - cd examples/web && netlify deploy --dir=.
      only:
        - master
    
    deploy-netlify-prod:
      stage: deploy
      script:
        - npm install netlify-cli -g
        - cd examples/web && netlify deploy --dir=. --prod
      only:
        - tags