Stop using gradlew in gitlab-ci, collapse proto codegen into a single job, add pipeline cacheing
These changes all make the pipeline run much faster for incremental builds.
This commit is contained in:
@@ -3,51 +3,40 @@ stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
protoc_base:
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- "**/Package.resolved"
|
||||
- "**/.build/"
|
||||
- .gradle/
|
||||
|
||||
protoc_gen:
|
||||
image: vato.ddns.net:8083/gradle
|
||||
stage: protoc
|
||||
rules:
|
||||
- changes:
|
||||
- protobuf/*
|
||||
script:
|
||||
- ./gradlew :protobuf:generateProto
|
||||
|
||||
protoc_python:
|
||||
extends: protoc_base
|
||||
rules:
|
||||
- changes:
|
||||
- pycar/*
|
||||
- protobuf/*
|
||||
- protobuf/*
|
||||
artifacts:
|
||||
paths:
|
||||
- "./**/*pb2*"
|
||||
- "./SwiftyCar/Sources/**/*.pb.swift"
|
||||
- "./SwiftyCar/Sources/**/*.grpc.swift"
|
||||
- "./CarControlleriOS/Sources/**/*.pb.swift"
|
||||
- "./CarControlleriOS/Sources/**/*.grpc.swift"
|
||||
expire_in: 30 days
|
||||
script:
|
||||
- ./gradlew :pycar:copyPythonCode
|
||||
|
||||
protoc_swift_Car:
|
||||
extends: protoc_base
|
||||
rules:
|
||||
- changes:
|
||||
- SwiftyCar/*
|
||||
- protobuf/*
|
||||
script:
|
||||
- ./gradlew :SwiftyCar:copySwiftCode
|
||||
|
||||
protoc_swift_CarController:
|
||||
extends: protoc_base
|
||||
rules:
|
||||
- changes:
|
||||
- CarControlleriOS/*
|
||||
- protobuf/*
|
||||
script:
|
||||
- ./gradlew :CarControlleriOS:copySwiftCode
|
||||
- gradle :pycar:copyPythonCode
|
||||
- gradle :SwiftyCar:copySwiftCode
|
||||
- gradle :CarControlleriOS:copySwiftCode
|
||||
|
||||
build_pycar:
|
||||
image: vato.ddns.net:8083/python-infra:buster
|
||||
stage: build
|
||||
rules:
|
||||
- changes:
|
||||
- pycar/*
|
||||
- protobuf/*
|
||||
needs:
|
||||
- protoc_python
|
||||
- pycar/*
|
||||
needs:
|
||||
- protoc_gen
|
||||
script:
|
||||
- cd pycar && python setup.py bdist_wheel && cd ..
|
||||
|
||||
@@ -56,20 +45,31 @@ build_pycar_docker:
|
||||
stage: build
|
||||
rules:
|
||||
- changes:
|
||||
- pycar/*
|
||||
- protobuf/*
|
||||
- pycar/*
|
||||
needs:
|
||||
- protoc_python
|
||||
- protoc_gen
|
||||
script:
|
||||
- echo ${DOCKER_PASSWORD} | docker login vato.ddns.net:8083 --username ${DOCKER_USERNAME} --password-stdin
|
||||
- docker build -f pycar/Dockerfile --build-arg PYPI_USERNAME=${PYPI_USERNAME} --build-arg PYPI_PASSWORD=${PYPI_PASSWORD} -t vato.ddns.net:8082/pycar:latest pycar
|
||||
|
||||
built_swift_car:
|
||||
image: vato.ddns.net:8083/swift
|
||||
stage: build
|
||||
rules:
|
||||
- changes:
|
||||
- SwiftyCar/*
|
||||
- protobuf/*
|
||||
needs:
|
||||
- protoc_gen
|
||||
script:
|
||||
- cd SwiftyCar && swift build
|
||||
|
||||
build_esp32:
|
||||
image: vato.ddns.net:8083/shaguarger/platformio
|
||||
stage: build
|
||||
rules:
|
||||
- changes:
|
||||
- esp32/*
|
||||
- esp32/*
|
||||
script:
|
||||
- platformio ci --project-conf esp32/platformio.ini esp32
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ func getVehicle2D() throws -> Vehicle2D? {
|
||||
let serialPort = SerialPort(path: "/dev/ttyUSB0")
|
||||
|
||||
// The port does not open/initialise inside of the ESP32ServoOutputs, as on macOS /dev/cu.* blocks.
|
||||
try initPort.openPort()
|
||||
initPort.setSettings(receiveRate: .baud115200, transmitRate: .baud115200, minimumBytesToRead: 1)x
|
||||
try serialPort.openPort()
|
||||
serialPort.setSettings(receiveRate: .baud115200, transmitRate: .baud115200, minimumBytesToRead: 1)
|
||||
guard let throttlePin = Esp32ServoOutput(forChannel: 1, forPin: 14, onPort: serialPort) else {
|
||||
print("Failed to create throttle pin.")
|
||||
return nil
|
||||
|
||||
@@ -16,5 +16,4 @@ org.gradle.jvmargs=-Xmx1536m
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Automatically convert third-party libraries to use AndroidX
|
||||
android.enableJetifier=true
|
||||
|
||||
android.enableJetifier=true
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user