|
| 1 | +target_steps: &target_steps |
| 2 | + docker: |
| 3 | + - image: circleci/rust:1.40.0 |
| 4 | + steps: |
| 5 | + - checkout |
| 6 | + - restore_cache: |
| 7 | + key: v1-ssd1331-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }} |
| 8 | + - run: sudo apt install -qq libsdl2-dev python-pip |
| 9 | + - run: sudo pip install linkchecker |
| 10 | + - run: rustup default ${RUST_VERSION:-stable} |
| 11 | + - run: rustup component add rustfmt |
| 12 | + - run: | |
| 13 | + SYSROOT=$(rustc --print sysroot) |
| 14 | +
|
| 15 | + if [[ ! "$SYSROOT" =~ "$TARGET" ]]; then |
| 16 | + rustup target add $TARGET |
| 17 | + else |
| 18 | + echo "Target $TARGET is already installed" |
| 19 | + fi |
| 20 | + - run: ./build.sh |
| 21 | + - save_cache: |
| 22 | + key: v1-ssd1331-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cargo.toml" }} |
| 23 | + paths: |
| 24 | + - ./target |
| 25 | + - /home/ubuntu/.cargo |
| 26 | + |
| 27 | +version: 2 |
| 28 | +jobs: |
| 29 | + target-arm-unknown-linux-eabi: |
| 30 | + environment: |
| 31 | + - TARGET: "arm-unknown-linux-gnueabi" |
| 32 | + - DISABLE_EXAMPLES: 1 |
| 33 | + <<: *target_steps |
| 34 | + |
| 35 | + target-armv7-unknown-linux-gnueabihf: |
| 36 | + environment: |
| 37 | + - TARGET: "armv7-unknown-linux-gnueabihf" |
| 38 | + - DISABLE_EXAMPLES: 1 |
| 39 | + <<: *target_steps |
| 40 | + |
| 41 | + target-x86_64-unknown-linux-gnu: |
| 42 | + environment: |
| 43 | + - TARGET: "x86_64-unknown-linux-gnu" |
| 44 | + - DISABLE_EXAMPLES: 1 |
| 45 | + <<: *target_steps |
| 46 | + |
| 47 | + target-x86_64-unknown-linux-musl: |
| 48 | + environment: |
| 49 | + - TARGET: "x86_64-unknown-linux-musl" |
| 50 | + - DISABLE_EXAMPLES: 1 |
| 51 | + <<: *target_steps |
| 52 | + |
| 53 | + target-thumbv6m-none-eabi: |
| 54 | + environment: |
| 55 | + - TARGET: "thumbv6m-none-eabi" |
| 56 | + # Disable example builds as they target thumbv7 and up |
| 57 | + - DISABLE_EXAMPLES: 1 |
| 58 | + <<: *target_steps |
| 59 | + |
| 60 | + target-thumbv7em-none-eabi: |
| 61 | + environment: |
| 62 | + - TARGET: "thumbv7em-none-eabi" |
| 63 | + <<: *target_steps |
| 64 | + |
| 65 | + target-thumbv7em-none-eabihf: |
| 66 | + environment: |
| 67 | + - TARGET: "thumbv7em-none-eabihf" |
| 68 | + <<: *target_steps |
| 69 | + |
| 70 | + target-thumbv7m-none-eabi: |
| 71 | + environment: |
| 72 | + - TARGET: "thumbv7m-none-eabi" |
| 73 | + <<: *target_steps |
| 74 | + |
| 75 | +build_jobs: &build_jobs |
| 76 | + jobs: |
| 77 | + # Raspberry Pi 1 |
| 78 | + - target-arm-unknown-linux-eabi |
| 79 | + |
| 80 | + # Raspberry Pi 2, 3, etc |
| 81 | + - target-armv7-unknown-linux-gnueabihf |
| 82 | + |
| 83 | + # Linux |
| 84 | + - target-x86_64-unknown-linux-gnu |
| 85 | + - target-x86_64-unknown-linux-musl |
| 86 | + |
| 87 | + # Bare metal |
| 88 | + - target-thumbv6m-none-eabi |
| 89 | + - target-thumbv7em-none-eabi |
| 90 | + - target-thumbv7em-none-eabihf |
| 91 | + - target-thumbv7m-none-eabi |
| 92 | + |
| 93 | +workflows: |
| 94 | + version: 2 |
| 95 | + build_all: |
| 96 | + <<: *build_jobs |
| 97 | + |
| 98 | + # Build every day |
| 99 | + nightly: |
| 100 | + <<: *build_jobs |
| 101 | + triggers: |
| 102 | + - schedule: |
| 103 | + cron: "0 0 * * *" |
| 104 | + filters: |
| 105 | + branches: |
| 106 | + only: |
| 107 | + - master |
0 commit comments