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 update
|
||||||
sudo apt-get install --no-install-recommends \
|
sudo apt-get install --no-install-recommends \
|
||||||
libgnutls30 libssl1.0.2 \
|
libgnutls30 libssl1.0.2 \
|
||||||
qemu-system-arm \
|
|
||||||
qemu-user \
|
|
||||||
gcc-avr \
|
|
||||||
avr-libc \
|
|
||||||
ninja-build \
|
ninja-build \
|
||||||
python3
|
python3
|
||||||
- install-node
|
|
||||||
- install-wasmtime
|
|
||||||
- install-cmake
|
- install-cmake
|
||||||
- hack-ninja-jobs
|
- hack-ninja-jobs
|
||||||
- install-xtensa-toolchain:
|
|
||||||
variant: "linux-amd64"
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
keys:
|
keys:
|
||||||
- go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
|
- go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
|
||||||
|
@ -274,10 +266,6 @@ commands:
|
||||||
llvm-build
|
llvm-build
|
||||||
- build-binaryen-linux-stretch
|
- build-binaryen-linux-stretch
|
||||||
- build-wasi-libc
|
- build-wasi-libc
|
||||||
- run:
|
|
||||||
name: "Test TinyGo"
|
|
||||||
command: make test
|
|
||||||
no_output_timeout: 20m
|
|
||||||
- run:
|
- run:
|
||||||
name: "Install fpm"
|
name: "Install fpm"
|
||||||
command: |
|
command: |
|
||||||
|
@ -289,6 +277,10 @@ commands:
|
||||||
make release deb -j3
|
make release deb -j3
|
||||||
cp -p build/release.tar.gz /tmp/tinygo.linux-amd64.tar.gz
|
cp -p build/release.tar.gz /tmp/tinygo.linux-amd64.tar.gz
|
||||||
cp -p build/release.deb /tmp/tinygo_amd64.deb
|
cp -p build/release.deb /tmp/tinygo_amd64.deb
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: /tmp
|
||||||
|
paths:
|
||||||
|
- tinygo.linux-amd64.tar.gz
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/tinygo.linux-amd64.tar.gz
|
path: /tmp/tinygo.linux-amd64.tar.gz
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
|
@ -298,12 +290,27 @@ commands:
|
||||||
paths:
|
paths:
|
||||||
- ~/.cache/go-build
|
- ~/.cache/go-build
|
||||||
- /go/pkg/mod
|
- /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:
|
- run:
|
||||||
name: "Extract release tarball"
|
name: "Extract release tarball"
|
||||||
command: |
|
command: |
|
||||||
mkdir -p ~/lib
|
mkdir -p ~/lib
|
||||||
tar -C ~/lib -xf /tmp/tinygo.linux-amd64.tar.gz
|
tar -C ~/lib -xf /tmp/workspace/tinygo.linux-amd64.tar.gz
|
||||||
ln -s ~/lib/tinygo/bin/tinygo /go/bin/tinygo
|
ln -s ~/lib/tinygo/bin/tinygo ~/go/bin/tinygo
|
||||||
tinygo version
|
tinygo version
|
||||||
- run: make smoketest
|
- run: make smoketest
|
||||||
build-macos:
|
build-macos:
|
||||||
|
@ -427,6 +434,11 @@ jobs:
|
||||||
- image: circleci/golang:1.17-stretch
|
- image: circleci/golang:1.17-stretch
|
||||||
steps:
|
steps:
|
||||||
- build-linux
|
- build-linux
|
||||||
|
test-linux-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/go:1.17
|
||||||
|
steps:
|
||||||
|
- test-linux-build
|
||||||
build-macos:
|
build-macos:
|
||||||
macos:
|
macos:
|
||||||
xcode: "11.1.0" # macOS 10.14
|
xcode: "11.1.0" # macOS 10.14
|
||||||
|
@ -441,5 +453,8 @@ workflows:
|
||||||
- test-llvm11-go115
|
- test-llvm11-go115
|
||||||
- test-llvm11-go116
|
- test-llvm11-go116
|
||||||
- build-linux
|
- build-linux
|
||||||
|
- test-linux-build:
|
||||||
|
requires:
|
||||||
|
- build-linux
|
||||||
- build-macos
|
- build-macos
|
||||||
- assert-test-linux
|
- assert-test-linux
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче