github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/.circleci/config.yml (about)

     1  version: 2.1
     2  orbs:
     3    slack: circleci/slack@3.4.0
     4    shellcheck: circleci/shellcheck@2.2.2
     5    win: circleci/windows@5.0.0
     6    gcp-cli: circleci/gcp-cli@3.0.1
     7    kubernetes: circleci/kubernetes@0.9.1
     8    go: circleci/go@1.7.1
     9  jobs:
    10    build-linux:
    11      resource_class: medium+
    12      docker:
    13        - image: docker/tilt-ci@sha256:d5862a9bfdad294feb50849bae1d9add22b1f5d0e750273c24683cc5edc2c4fa
    14      # apiserver code generation scripts require being in GOPATH
    15      working_directory: /home/circleci/go/src/github.com/tilt-dev/tilt
    16  
    17      steps:
    18        - checkout
    19        - run: echo 'export PATH=~/go/bin:$PATH' >> $BASH_ENV
    20        - setup_remote_docker
    21        - run: docker pull registry:2
    22        - run: sudo mv /usr/bin/helm3 /usr/bin/helm
    23        - run: make install
    24        - run: make lint
    25        - run: make test_install_version_check
    26        - run: make wire-check
    27        - run: ./scripts/check-codegen.sh
    28        - run: make test-go
    29        - store_test_results:
    30            path: test-results
    31        - slack/notify-on-failure:
    32            only_for_branches: master
    33  
    34    build-js:
    35      docker:
    36        - image: cimg/node:20.7.0
    37      steps:
    38        - checkout
    39        - run: make check-js
    40        - run:
    41            name: Run jest with JUnit Reporter
    42            command: make test-js
    43            environment:
    44              JEST_JUNIT_OUTPUT_DIR: "reports/junit/js-test-results.xml"
    45        - run: make test-storybook
    46        - store_test_results:
    47            path: web/reports/junit
    48        - slack/notify-on-failure:
    49            only_for_branches: master
    50  
    51    check-docs:
    52      docker:
    53        - image: docker/tilt-ci@sha256:d5862a9bfdad294feb50849bae1d9add22b1f5d0e750273c24683cc5edc2c4fa
    54      steps:
    55        - checkout
    56        - setup_remote_docker
    57        - run: mkdir -p ../tilt.build && git clone git@github.com:tilt-dev/tilt.build ../tilt.build
    58        - run: make install
    59        - run: |
    60            set -ex
    61            cd ../tilt.build
    62            tilt dump cli-docs --dir="./docs/cli"
    63            tilt dump api-docs --dir="./api"
    64            make cli-toc
    65            make api
    66        - slack/notify-on-failure:
    67            only_for_branches: master
    68  
    69    build-windows:
    70      executor:
    71        name: win/default
    72        size: "large"
    73      steps:
    74        - run: |
    75            choco install -y make kustomize kubernetes-helm docker-compose
    76            choco upgrade -y --allow-downgrade golang --version=1.22.2
    77  
    78            # mingw 13 seems to have broken gcc installs
    79            # https://community.chocolatey.org/packages/mingw#comment-6290804217
    80            choco install -y mingw --version 12.2.0.03042023 --allow-downgrade
    81        - run: go install gotest.tools/gotestsum@latest
    82        - checkout
    83        # Check to make sure Windows binaries compile
    84        - run:
    85            command: go install -mod vendor ./cmd/tilt
    86            shell: bash.exe
    87            environment:
    88              CGO_ENABLED: '1'
    89              CGO_LDFLAGS: -static
    90        - run:
    91            command: PATH="$HOME/go/bin:$PATH" make shorttestsum
    92            shell: bash.exe
    93            environment:
    94              CGO_ENABLED: '1'
    95              CGO_LDFLAGS: -static
    96        - run: iex ./scripts/install.ps1
    97        - store_test_results:
    98            path: test-results
    99  
   100    build-integration:
   101      resource_class: medium+
   102      docker:
   103        - image: docker/tilt-integration-ci@sha256:17d2fc2c7de751bbc6aa750a362e556c6b4277c168457460a67d6d31455eec4d
   104      steps:
   105        - checkout
   106        - run: echo 'export PATH=/go/bin:$PATH' >> $BASH_ENV
   107        - setup_remote_docker
   108        - run: ctlptl create cluster kind --registry=ctlptl-registry && make build-js integration
   109        - store_test_results:
   110            path: test-results
   111        - slack/notify-on-failure:
   112            only_for_branches: master
   113  
   114    test-extensions:
   115      resource_class: large
   116      docker:
   117        - image: docker/tilt-extensions-ci@sha256:996c1dc73f2740fe7d3057264b75d8f2614b0b1b929e11aa580c7e3f8c7ded8e
   118      steps:
   119        - checkout
   120        - run: echo 'export PATH=/go/bin:$PATH' >> $BASH_ENV
   121        - setup_remote_docker
   122        - run: ctlptl create cluster kind --registry=ctlptl-registry && make build-js install test-extensions
   123        - slack/notify-on-failure:
   124            only_for_branches: master
   125  
   126    build-macos:
   127      resource_class: "macos.x86.medium.gen2"
   128      macos:
   129        xcode: "15.0.0"
   130  
   131      steps:
   132        - checkout
   133        - go/install:
   134            version: "1.22.2"
   135        - run: curl -fsSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.7.0/gotestsum_1.7.0_darwin_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
   136        # We can't run the container tests on macos because nested
   137        # VMs don't work on circleci.
   138        - run: mkdir -p test-results
   139        # Check to make sure binaries compile
   140        - run: go install -mod vendor ./cmd/tilt
   141        # Only run watch tests, because these are currently the only tests that are OS-specific.
   142        # In other Tilt tests, we mock out OS-specific components.
   143        - run: gotestsum --format standard-quiet --junitfile test-results/unit-tests.xml -- -mod vendor ./internal/watch/...
   144        - store_test_results:
   145            path: test-results
   146        - slack/notify-on-failure:
   147            only_for_branches: master
   148  
   149    release-dry-run:
   150      resource_class: medium+
   151      docker:
   152        # keep image in sync with build.toast.yml
   153        - image: docker/tilt-releaser@sha256:e626c30b4b6d42056182f530563eaf80df72441bc37f49e7a707395428aab725
   154      environment:
   155        DOCKER_CLI_EXPERIMENTAL: enabled
   156      steps:
   157        - setup_remote_docker
   158        # https://discuss.circleci.com/t/arm-version-of-remote-docker/41624
   159        - run: ssh remote-docker "sudo apt-get update; sudo apt-get install -y qemu-user-static binfmt-support"
   160        - checkout
   161        - run: make build-js
   162        - run: goreleaser --debug --clean --skip-publish --snapshot
   163        - slack/notify-on-failure:
   164            only_for_branches: main
   165  
   166    release:
   167      resource_class: medium+
   168      docker:
   169        # keep image in sync with build.toast.yml
   170        - image: docker/tilt-releaser@sha256:e626c30b4b6d42056182f530563eaf80df72441bc37f49e7a707395428aab725
   171      environment:
   172        DOCKER_CLI_EXPERIMENTAL: enabled
   173      steps:
   174        - setup_remote_docker
   175        # https://discuss.circleci.com/t/arm-version-of-remote-docker/41624
   176        - run: ssh remote-docker "sudo apt-get update; sudo apt-get install -y qemu-user-static binfmt-support"
   177        - slack/notify:
   178            message: "A Tilt release has started!"
   179        - checkout
   180        - run: ./scripts/release-ci.sh
   181        - slack/status
   182  
   183  workflows:
   184    version: 2
   185    shellcheck:
   186      jobs:
   187        - shellcheck/check:
   188            dir: scripts
   189            exclude: SC2001
   190  
   191    build:
   192      # The linux job is cheaper than the others, so run that first.
   193      jobs:
   194        - build-linux
   195        - build-js:
   196            requires:
   197              - build-linux
   198        - build-macos:
   199            requires:
   200              - build-linux
   201        - build-integration:
   202            requires:
   203              - build-linux
   204        - test-extensions:
   205            context:
   206              - Tilt Pulumi Context
   207            requires:
   208              - build-linux
   209        - build-windows:
   210            requires:
   211              - build-linux
   212        - check-docs:
   213            requires:
   214              - build-linux
   215        - release-dry-run:
   216            context: Tilt Slack Context
   217            requires:
   218              - build-linux
   219            filters:
   220              branches:
   221                only: master
   222  
   223    release:
   224      jobs:
   225        - release:
   226            context:
   227              - Tilt Slack Context
   228              - Tilt Release CLI Context
   229              - Tilt Docker Login Context
   230              - Tilt Cloud Login Context
   231              - Tilt Deploy Context
   232            filters:
   233              branches:
   234                only: never-release-on-a-branch
   235              tags:
   236                only: /v[0-9]+.[0-9]+.[0-9]+/