user50362: I'm trying to do some simple unit testing with arduino-cli in a .gitlab-ci file like so
variables:
  DOCKER_HOST: tcp://docker:2375

image: "docker:latest"

services:
  - docker:dind


before_script:
  - docker pull "arduino/arduino-cli:latest"
  - arduinocli(){ docker run arduino/arduino-cli:latest "$@";}

search:
  script:
    - arduinocli lib search hi

but instead of arduinocli lib search hi at the end, I want to verify my sketch. Is there a way to do this with arduino-cli?

user50362: @Majenko's is 100 % correct. Here's my updated .gitlab-ci.yml for my arduino library.
image: ubuntu:latest

before_script:
  - apt-get update -yq
  - apt-get install -yq ca-certificates
  - apt-get update && apt-get install -y --no-install-recommends bzip2 curl unzip
  - apt-get upgrade -yq
  - curl -L -o arduino-cli.tar.bz2 https://github.com/arduino/arduino-cli/releases/download/0.3.3-alpha.preview/arduino-cli-0.3.3-alpha.preview-linux64.tar.bz2
  - tar xjf arduino-cli.tar.bz2
  - mv arduino-cli-0.3.3-alpha.preview-linux64 /usr/bin/ino
  - export APPDIR=$(ino config dump | grep --only-matching --regexp=/.*/Arduino)"/libraries/DC_motors"
  - mkdir --parents $APPDIR
  - mv ./* $APPDIR

test:
  script:
    - echo 'run a script'

compile:
  script:
    - ino core update-index
    - ino core install arduino:avr
    - ino core list
    - ino lib install "Adafruit Motor Shield V2 Library"
    - ino lib search Regexp
    - ino lib install Regexp
    - ino lib install AccelStepper
    - ino compile --fqbn arduino:avr:uno $APPDIR/examples/API

In case that library moves, here's the tree output of DC_motors
├── examples
│   └── API
│       └── API.ino
├── extras
│   ├── test
│   │   └── Makefile
│   └── testPython.py
├── .gitignore
├── .gitlab-ci.yml
├── keywords.txt
├── library.properties
├── README.md
└── src
    ├── MSv2.cpp
    ├── MSv2.h
    ├── MSv2Motors.cpp
    ├── MSv2Motors.h
    ├── MSv2Steppers.cpp
    ├── MSv2Steppers.h
    └── utility
        ├── MSv2Common.cpp
        └── MSv2Common.h


user4143: In Arduino parlance the word "Verify" is used (erroneously) to mean "Compile the code into a binary or HEX file, but don't upload it to the board". 
To compile (and thus "verify") the code just pass the compile command to arduino-cli with the board you want to compile for and the sketch you want to compile.

50362: <p>I'm trying to do some simple unit testing with <a href="https://github.com/arduino/arduino-cli#arduino-cli" rel="nofollow noreferrer">arduino-cli</a> in a .gitlab-ci file like so</p>

<pre><code>variables:
  DOCKER_HOST: tcp://docker:2375

image: "docker:latest"

services:
  - docker:dind


before_script:
  - docker pull "arduino/arduino-cli:latest"
  - arduinocli(){ docker run arduino/arduino-cli:latest "$@";}

search:
  script:
    - arduinocli lib search hi
</code></pre>

<p>but instead of <code>arduinocli lib search hi</code> at the end, I want to verify my sketch. Is there a way to do this with arduino-cli?</p>
 50362: <p>@Majenko's is 100 % correct. Here's my updated <code>.gitlab-ci.yml</code> for <a href="https://gitlab.com/robotics_fun/DC_motors" rel="nofollow noreferrer">my arduino library</a>.</p>

<pre><code>image: ubuntu:latest

before_script:
  - apt-get update -yq
  - apt-get install -yq ca-certificates
  - apt-get update &amp;&amp; apt-get install -y --no-install-recommends bzip2 curl unzip
  - apt-get upgrade -yq
  - curl -L -o arduino-cli.tar.bz2 https://github.com/arduino/arduino-cli/releases/download/0.3.3-alpha.preview/arduino-cli-0.3.3-alpha.preview-linux64.tar.bz2
  - tar xjf arduino-cli.tar.bz2
  - mv arduino-cli-0.3.3-alpha.preview-linux64 /usr/bin/ino
  - export APPDIR=$(ino config dump | grep --only-matching --regexp=/.*/Arduino)"/libraries/DC_motors"
  - mkdir --parents $APPDIR
  - mv ./* $APPDIR

test:
  script:
    - echo 'run a script'

compile:
  script:
    - ino core update-index
    - ino core install arduino:avr
    - ino core list
    - ino lib install "Adafruit Motor Shield V2 Library"
    - ino lib search Regexp
    - ino lib install Regexp
    - ino lib install AccelStepper
    - ino compile --fqbn arduino:avr:uno $APPDIR/examples/API
</code></pre>

<p>In case that library moves, here's the tree output of <code>DC_motors</code></p>

<pre><code>├── examples
│   └── API
│       └── API.ino
├── extras
│   ├── test
│   │   └── Makefile
│   └── testPython.py
├── .gitignore
├── .gitlab-ci.yml
├── keywords.txt
├── library.properties
├── README.md
└── src
    ├── MSv2.cpp
    ├── MSv2.h
    ├── MSv2Motors.cpp
    ├── MSv2Motors.h
    ├── MSv2Steppers.cpp
    ├── MSv2Steppers.h
    └── utility
        ├── MSv2Common.cpp
        └── MSv2Common.h
</code></pre>
 4143: <p>In Arduino parlance the word "Verify" is used (erroneously) to mean "Compile the code into a binary or HEX file, but don't upload it to the board". </p>

<p>To compile (and thus "verify") the code just pass the <code>compile</code> command to <code>arduino-cli</code> with the board you want to compile for and the sketch you want to compile.</p>
