From da13409e9e6b23645a98d54e8c07bf716622eccc Mon Sep 17 00:00:00 2001 From: Dawson Coleman Date: Mon, 13 Sep 2021 16:46:11 -0500 Subject: [PATCH 1/2] Add example .gitlab-ci.yml from pio docs Copy and pasted from https://docs.platformio.org/en/latest/integration/ci/gitlab.html with a few small changes. --- .gitlab-ci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..6ba5d0cea --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,20 @@ +image: python:3.9 + +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache" + PLATFORMIO_CACHE_DIR: "$CI_PROJECT_DIR/.platformio-cache" + +cache: + paths: + - .pip-cache/ + - .platformio-cache/ + +stages: + - build + +before_script: + - "pip install -U platformio" + +build_all: + stage: build + script: "pio run" \ No newline at end of file From 39202b8e7c6a675c4a3a073fa79594dbd9a56f6b Mon Sep 17 00:00:00 2001 From: Dawson Coleman Date: Tue, 14 Sep 2021 16:41:22 -0500 Subject: [PATCH 2/2] Use parallel jobs and expose artifacts --- .gitlab-ci.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ba5d0cea..9b3e1b55a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,11 +10,26 @@ cache: - .platformio-cache/ stages: - - build + - build before_script: - "pip install -U platformio" build_all: stage: build - script: "pio run" \ No newline at end of file + script: + - pio run -e $PIO_ENV + # Workaround for artifacts:expose_as not being compatible with the use of variables in artifacts:paths + # Instead we can move the firmware from env folder to a common location + - mv .pio/build/$PIO_ENV/firmware.hex . || true + - mv .pio/build/$PIO_ENV/firmware.bin . || true + parallel: + matrix: + - PIO_ENV: [MiniV2, TAZ6, Workhorse, TAZPro, TAZProXT, Sidekick_289, Sidekick_747] + artifacts: + expose_as: firmware + name: $PIO_ENV-$CI_PIPELINE_IID-$CI_COMMIT_SHA + paths: + - firmware.hex + - firmware.bin + expire_in: 14 days \ No newline at end of file