You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
197 lines
5.7 KiB
197 lines
5.7 KiB
pr: none
|
|
|
|
variables:
|
|
- group: shared-variables
|
|
|
|
jobs:
|
|
- job: build
|
|
pool:
|
|
vmImage: 'ubuntu-16.04'
|
|
steps:
|
|
- checkout: self
|
|
lfs: true
|
|
submodules: true
|
|
persistCredentials: true
|
|
- script: |
|
|
HEADER=$(git config http.https://github.com/commaai/one.extraheader)
|
|
|
|
mkdir xx
|
|
cd xx
|
|
|
|
git init
|
|
git remote add origin https://github.com/commaai/xx
|
|
git config gc.auto 0
|
|
git lfs install --local
|
|
|
|
git -c http.extraheader="$HEADER" fetch --force --tags --prune --progress --no-recurse-submodules origin
|
|
HASH=$(git rev-parse origin/master)
|
|
git -c http.https://github.com.extraheader="$HEADER" lfs fetch origin $HASH
|
|
git checkout --progress --force $HASH
|
|
displayName: Checkout xx
|
|
- script: |
|
|
until docker login commaregistry.azurecr.io -u commaregistry -p "${COMMAREGISTRY_PASSWORD}"
|
|
do
|
|
echo "Try again"
|
|
done
|
|
displayName: Registry login
|
|
env:
|
|
COMMAREGISTRY_PASSWORD: $(COMMAREGISTRY_PASSWORD)
|
|
- script: |
|
|
docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile.openpilot_ci) || true
|
|
docker pull commaregistry.azurecr.io/openpilot_ci:latest || true
|
|
docker build \
|
|
--cache-from commaregistry.azurecr.io/openpilot_ci:latest \
|
|
-t commaregistry.azurecr.io/openpilot_ci:latest \
|
|
-t commaregistry.azurecr.io/openpilot_ci:${BUILD_SOURCEVERSION} \
|
|
-f Dockerfile.openpilot_ci .
|
|
displayName: Docker build
|
|
- script: |
|
|
docker push commaregistry.azurecr.io/openpilot_ci:latest
|
|
docker push commaregistry.azurecr.io/openpilot_ci:${BUILD_SOURCEVERSION}
|
|
displayName: Docker push
|
|
|
|
- job: linter
|
|
displayName: Linter
|
|
container:
|
|
image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion)
|
|
endpoint: commaregistry
|
|
dependsOn: build
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
set -e
|
|
export PATH=/root/.pyenv/bin:/root/.pyenv/shims:$PATH
|
|
export PYTHONPATH=/tmp/openpilot
|
|
|
|
cd /tmp/openpilot
|
|
/tmp/openpilot/flake8_openpilot.sh
|
|
/tmp/openpilot/pylint_openpilot.sh
|
|
EOF
|
|
displayName: Linter
|
|
|
|
- job: unittest
|
|
displayName: Unit Tests
|
|
container:
|
|
image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion)
|
|
endpoint: commaregistry
|
|
dependsOn: linter
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
set -e
|
|
|
|
export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH
|
|
export PYTHONPATH=/tmp/openpilot
|
|
|
|
/tmp/openpilot/selfdrive/test/test_fingerprints.py
|
|
/tmp/openpilot/selfdrive/locationd/test/ci_test.py
|
|
|
|
cd /tmp/openpilot
|
|
python -m unittest discover common
|
|
python -m unittest discover selfdrive/car
|
|
python -m unittest discover selfdrive/boardd
|
|
python -m unittest discover selfdrive/loggerd
|
|
python -m unittest discover selfdrive/controls
|
|
python -m unittest discover selfdrive/locationd
|
|
python -m unittest discover selfdrive/athena
|
|
|
|
EOF
|
|
displayName: Unittests
|
|
|
|
- job: quick_check
|
|
displayName: Test car models
|
|
container:
|
|
image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion)
|
|
endpoint: commaregistry
|
|
options: --shm-size 1G
|
|
dependsOn: linter
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
set -e
|
|
export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH
|
|
export PYTHONPATH=/tmp/openpilot
|
|
export EXTERNAL=1
|
|
export CI=1
|
|
export AZUTIL_KEYS=/tmp/openpilot/selfdrive/test/commadataci.json
|
|
export UNLOGGER_PATH=xx/chffr/unlogger/unlogger.py
|
|
|
|
mkdir -p /data/params
|
|
|
|
cd /tmp/openpilot
|
|
/tmp/openpilot/selfdrive/test/test_car_models.py
|
|
EOF
|
|
|
|
- job: longitudinal_test
|
|
displayName: Longitudinal Test
|
|
container:
|
|
image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion)
|
|
endpoint: commaregistry
|
|
volumes:
|
|
- /tmp/out:/tmp/out
|
|
options: --shm-size 1G
|
|
dependsOn: linter
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
set -e
|
|
export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH
|
|
export PYTHONPATH=/tmp/openpilot
|
|
|
|
cd /tmp/openpilot
|
|
/tmp/openpilot/selfdrive/test/longitudinal_maneuvers/test_longitudinal.py
|
|
cp -r /tmp/openpilot/out/longitudinal /tmp/out
|
|
EOF
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathtoPublish: /tmp/out
|
|
artifactName: out
|
|
|
|
- job: process_replay
|
|
displayName: Process Replay
|
|
container:
|
|
image: commaregistry.azurecr.io/openpilot_ci:$(Build.SourceVersion)
|
|
endpoint: commaregistry
|
|
volumes:
|
|
- /tmp/out:/tmp/out
|
|
options: --shm-size 1G
|
|
dependsOn: linter
|
|
steps:
|
|
- checkout: none
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
set -e
|
|
|
|
export PATH=/root/.pyenv/bin:/root/.pyenv/shims:/tmp/openpilot/external/bin:$PATH
|
|
export PYTHONPATH=/tmp/openpilot
|
|
export PYTHONUNBUFFERED=1
|
|
export CI=1
|
|
|
|
cd /tmp/openpilot
|
|
pip install coverage==4.5.4
|
|
coverage run --branch --concurrency=thread -p /tmp/openpilot/selfdrive/test/process_replay/test_processes.py
|
|
coverage combine
|
|
coverage html -d /tmp/out/coverage
|
|
|
|
EOF
|
|
displayName: Run replay
|
|
- script: |
|
|
sudo -i -u root bash << EOF
|
|
cp /tmp/openpilot/selfdrive/test/process_replay/diff.txt /tmp/out/diff.txt
|
|
EOF
|
|
condition: succeededOrFailed()
|
|
displayName: Copy diff
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathtoPublish: /tmp/out/diff.txt
|
|
artifactName: diff.txt
|
|
condition: succeededOrFailed()
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
pathtoPublish: /tmp/out/coverage
|
|
artifactName: coverage
|
|
condition: succeededOrFailed()
|
|
|