diff options
author | Ayke van Laethem <[email protected]> | 2021-11-16 14:40:51 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-11-16 18:43:32 +0100 |
commit | 2081380b5c83258d7e23616b26654c9a7eec3655 (patch) | |
tree | 56e81a6583e1be3b64553f6497f9e820ffa09f81 /.circleci | |
parent | 3d0c6dd02d6bff8a379fcdb9d4d0aeb1b5ce8ba7 (diff) | |
download | tinygo-2081380b5c83258d7e23616b26654c9a7eec3655.tar.gz tinygo-2081380b5c83258d7e23616b26654c9a7eec3655.zip |
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.
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index ab5ae064b..a7e138432 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 }} @@ -275,10 +267,6 @@ commands: - build-binaryen-linux-stretch - build-wasi-libc - run: - name: "Test TinyGo" - command: make test - no_output_timeout: 20m - - run: name: "Install fpm" command: | sudo apt-get install ruby ruby-dev @@ -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 |