aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: 26b2722acc376ecd3018a6a1967e3c943498e3e3 (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
name: CI

on:
  push:
  pull_request:
  schedule: [cron: "40 1 * * *"]

jobs:
  test:
    name: ${{matrix.name || format('Rust {0}', matrix.rust)}}
    runs-on: ${{matrix.os || 'ubuntu'}}-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - rust: nightly
          - rust: beta
          - rust: stable
          - rust: 1.43.0
          - name: macOS
            rust: nightly
            os: macos
          - name: Windows (gnu)
            rust: nightly-x86_64-pc-windows-gnu
            os: windows
          - name: Windows (msvc)
            rust: nightly-x86_64-pc-windows-msvc
            os: windows
    steps:
      - name: Enable symlinks (windows)
        if: matrix.os == 'windows'
        run: git config --global core.symlinks true
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{matrix.rust}}
      - name: Determine test suite subset
        # Our Windows and macOS jobs are the longest running, so exclude the
        # relatively slow compiletest from them to speed up end-to-end CI time,
        # except during cron builds when no human is presumably waiting on the
        # build. The extra coverage is not particularly valuable and we can
        # still ensure the test is kept passing on the basis of the scheduled
        # builds.
        if: matrix.os && github.event_name != 'schedule'
        run: echo '::set-env name=RUSTFLAGS::--cfg skip_ui_tests'
      - run: cargo run --manifest-path demo/Cargo.toml
      - run: cargo test --workspace --exclude cxx-test-suite

  buck:
    name: Buck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@stable
      - uses: actions/setup-java@v1
        with:
          java-version: 11
          java-package: jre
      - name: Install Buck
        run: |
          mkdir bin
          wget -q -O bin/buck https://jitpack.io/com/github/facebook/buck/a5f0342ae3/buck-a5f0342ae3-java11.pex # dev branch from 2020.10.11
          chmod +x bin/buck
          echo bin >> $GITHUB_PATH
      - name: Install lld
        run: sudo apt install lld
      - name: Vendor dependencies
        run: |
          cp third-party/Cargo.lock .
          cargo vendor --versioned-dirs --locked third-party/vendor
      - run: buck build :cxx#check --verbose=0
      - run: buck run demo --verbose=0
      - run: buck test ... --verbose=0

  bazel:
    name: Bazel
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Bazel
        run: |
          wget -q -O install.sh https://github.com/bazelbuild/bazel/releases/download/2.1.1/bazel-2.1.1-installer-linux-x86_64.sh
          chmod +x install.sh
          ./install.sh --user
          echo $HOME/bin >> $GITHUB_PATH
      - run: bazel run demo --verbose_failures --noshow_progress
      - run: bazel test ... --verbose_failures --noshow_progress

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: dtolnay/rust-toolchain@clippy
      - run: cargo clippy --workspace --tests -- -Dclippy::all