aboutsummaryrefslogtreecommitdiffhomepage
path: root/.circleci/config.yml
blob: c681cd8a9b6b83f6b79e745b7b008093725f03f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
version: 2.1

commands:
  submodules:
    steps:
      - run:
          name: "Pull submodules"
          command: git submodule update --init
  apt-dependencies:
    parameters:
      llvm:
        type: string
    steps:
      - run:
          name: "Install apt dependencies"
          command: |
            echo 'deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch<<parameters.llvm>> main' | sudo tee /etc/apt/sources.list.d/llvm.list
            wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
            sudo apt-get update
            sudo apt-get install \
                llvm \
                python3 \
                llvm<<parameters.llvm>>-dev \
                clang<<parameters.llvm>> \
                libclang<<parameters.llvm>>-dev \
                lld<<parameters.llvm>> \
                gcc-arm-linux-gnueabihf \
                binutils-arm-none-eabi \
                libc6-dev-armel-cross \
                gcc-aarch64-linux-gnu \
                libc6-dev-arm64-cross \
                qemu-system-arm \
                qemu-user \
                gcc-avr \
                avr-libc
  install-node:
    steps:
      - run:
          name: "Install node.js"
          command: |
            wget https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.xz
            sudo tar -C /usr/local -xf node-v10.15.1-linux-x64.tar.xz
            sudo ln -s /usr/local/node-v10.15.1-linux-x64/bin/node /usr/bin/node
            rm node-v10.15.1-linux-x64.tar.xz
  dep:
    steps:
      - run:
          name: "Install Go dependencies"
          command: |
            curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
            dep ensure --vendor-only
  smoketest:
    steps:
      - run: tinygo build -size short -o test.elf -target=pca10040            examples/blinky1
      - run: tinygo build -size short -o test.elf -target=pca10040            examples/blinky2
      - run: tinygo build -size short -o blinky2                              examples/blinky2
      - run: tinygo build -size short -o test.elf -target=pca10040            examples/test
      - run: tinygo build -size short -o test.elf -target=microbit            examples/echo
      - run: tinygo build -size short -o test.elf -target=nrf52840-mdk        examples/blinky1
      - run: tinygo build -size short -o test.elf -target=pca10031            examples/blinky1
      - run: tinygo build -size short -o test.elf -target=bluepill            examples/blinky1
      - run: tinygo build -size short -o test.elf -target=arduino             examples/blinky1
      - run: tinygo build -size short -o test.elf -target=digispark           examples/blinky1
      - run: tinygo build -size short -o test.elf -target=reelboard           examples/blinky1
      - run: tinygo build -size short -o test.elf -target=reelboard           examples/blinky2
      - run: tinygo build -size short -o test.elf -target=pca10056            examples/blinky1
      - run: tinygo build -size short -o test.elf -target=pca10056            examples/blinky2
      - run: tinygo build -size short -o test.elf -target=itsybitsy-m0        examples/blinky1
      - run: tinygo build -size short -o test.elf -target=circuitplay-express examples/blinky1


jobs:
  test-llvm7-go111:
    docker:
      - image: circleci/golang:1.11

    working_directory: /go/src/github.com/tinygo-org/tinygo
    steps:
      - checkout
      - submodules
      - apt-dependencies:
          llvm: "-7"
      - install-node
      - restore_cache:
          keys:
            - go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
            - go-cache-{{ checksum "Gopkg.lock" }}
      - dep
      - run: go install .
      - run: make test
      - run: make gen-device -j4
      - smoketest
      - save_cache:
          key: go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
          paths:
            - ~/.cache/go-build
            - ~/.cache/tinygo

workflows:
  test-all:
    jobs:
      - test-llvm7-go111