aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
blob: 467bf1f56e3bb8f4a80f3c4ed1cdf0ae4dbc055f (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
name: CI

on:
  push:
    branches: [auto]
  pull_request:
  workflow_dispatch:

jobs:
  ci:
    name: Build/Test
    strategy:
      matrix:
        toolchain: ["stable", "beta", "nightly", "1.36.0"]
        os: [ubuntu-latest]
        include:
          - toolchain: stable
            env:
              DO_FUZZ: 1
          - toolchain: beta
            env:
              DO_FUZZ: 1
          - os: windows-latest
            toolchain: nightly

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v2

      - name: Install packages
        if: matrix.os == 'ubuntu-latest'
        run: sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.toolchain }}
          override: true

      - name: Cargo build
        run: cargo build --verbose

      - name: Cargo test
        if: matrix.toolchain != '1.36.0'
        run: cargo test --verbose

      - name: Cargo test w/ serde
        if: matrix.toolchain != '1.36.0'
        run: cargo test --verbose --features serde

      - name: Cargo check w/o default features
        if: matrix.toolchain == 'nightly'
        run: cargo check --verbose --no-default-features

      - name: Cargo test w/ union
        if: matrix.toolchain == 'beta'
        run: cargo test --verbose --features union

      - name: Cargo test w/ debugger_visualizer
        if: matrix.toolchain == 'nightly'
        run: cargo test --test debugger_visualizer --verbose --features debugger_visualizer -- --test-threads=1

      - name: Cargo test w/ debugger_visualizer and union
        if: matrix.toolchain == 'nightly'
        run: cargo test --test debugger_visualizer --verbose --features 'debugger_visualizer,union' -- --test-threads=1

      - name: Cargo test all features
        if: matrix.toolchain == 'nightly'
        run: cargo test --verbose --all-features

      - name: Cargo bench
        if: matrix.toolchain == 'nightly'
        run: cargo bench --verbose bench

      - name: miri
        if: matrix.toolchain == 'nightly' && matrix.os == 'ubuntu-latest'
        run: bash ./scripts/run_miri.sh
        env:
          MIRIFLAGS: '-Zmiri-tag-raw-pointers'

      - name: fuzz
        if: env.DO_FUZZ == '1'
        working-directory: fuzz
        run: ./travis_fuzz.sh

  build_result:
    name: homu build finished
    runs-on: ubuntu-latest
    needs:
      - "ci"

    steps:
      - name: Mark the job as successful
        run: exit 0
        if: success()
      - name: Mark the job as unsuccessful
        run: exit 1
        if: "!success()"