ci: simplify build-linux job
Split building the release and smoke-testing the release in two, and don't redo some tests that are already done by assert-test-linux. Some benefits: - Lower overall CI time because tests aren't done multiple times. - TinyHCI can run earlier because the build-linux job is finished as soon as the build artifact is ready. It does however have the downside of an extra job, which costs a few seconds to spin up and a few seconds to push and pull the workspace. But even with this, overall CI time is down by a few minutes per workflow run.
Этот коммит содержится в:
родитель
3d0c6dd02d
коммит
2081380b5c
1 изменённых файлов: 29 добавлений и 14 удалений
|
@ -236,18 +236,10 @@ commands:
|
|||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends \
|
||||
libgnutls30 libssl1.0.2 \
|
||||
qemu-system-arm \
|
||||
qemu-user \
|
||||
gcc-avr \
|
||||
avr-libc \
|
||||
ninja-build \
|
||||
python3
|
||||
- install-node
|
||||
- install-wasmtime
|
||||
- install-cmake
|
||||
- hack-ninja-jobs
|
||||
- install-xtensa-toolchain:
|
||||
variant: "linux-amd64"
|
||||
- restore_cache:
|
||||
keys:
|
||||
- go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
|
||||
|
@ -274,10 +266,6 @@ commands:
|
|||
llvm-build
|
||||
- build-binaryen-linux-stretch
|
||||
- build-wasi-libc
|
||||
- run:
|
||||
name: "Test TinyGo"
|
||||
command: make test
|
||||
no_output_timeout: 20m
|
||||
- run:
|
||||
name: "Install fpm"
|
||||
command: |
|
||||
|
@ -289,6 +277,10 @@ commands:
|
|||
make release deb -j3
|
||||
cp -p build/release.tar.gz /tmp/tinygo.linux-amd64.tar.gz
|
||||
cp -p build/release.deb /tmp/tinygo_amd64.deb
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- tinygo.linux-amd64.tar.gz
|
||||
- store_artifacts:
|
||||
path: /tmp/tinygo.linux-amd64.tar.gz
|
||||
- store_artifacts:
|
||||
|
@ -298,12 +290,27 @@ commands:
|
|||
paths:
|
||||
- ~/.cache/go-build
|
||||
- /go/pkg/mod
|
||||
test-linux-build:
|
||||
# Now run the smoke tests for the generated binary.
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: /tmp/workspace
|
||||
- checkout
|
||||
- run:
|
||||
name: "Install apt dependencies"
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --no-install-recommends \
|
||||
gcc-avr \
|
||||
avr-libc
|
||||
- install-xtensa-toolchain:
|
||||
variant: "linux-amd64"
|
||||
- run:
|
||||
name: "Extract release tarball"
|
||||
command: |
|
||||
mkdir -p ~/lib
|
||||
tar -C ~/lib -xf /tmp/tinygo.linux-amd64.tar.gz
|
||||
ln -s ~/lib/tinygo/bin/tinygo /go/bin/tinygo
|
||||
tar -C ~/lib -xf /tmp/workspace/tinygo.linux-amd64.tar.gz
|
||||
ln -s ~/lib/tinygo/bin/tinygo ~/go/bin/tinygo
|
||||
tinygo version
|
||||
- run: make smoketest
|
||||
build-macos:
|
||||
|
@ -427,6 +434,11 @@ jobs:
|
|||
- image: circleci/golang:1.17-stretch
|
||||
steps:
|
||||
- build-linux
|
||||
test-linux-build:
|
||||
docker:
|
||||
- image: cimg/go:1.17
|
||||
steps:
|
||||
- test-linux-build
|
||||
build-macos:
|
||||
macos:
|
||||
xcode: "11.1.0" # macOS 10.14
|
||||
|
@ -441,5 +453,8 @@ workflows:
|
|||
- test-llvm11-go115
|
||||
- test-llvm11-go116
|
||||
- build-linux
|
||||
- test-linux-build:
|
||||
requires:
|
||||
- build-linux
|
||||
- build-macos
|
||||
- assert-test-linux
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче