1name: All Tests and Builds
2
3on:
4  push:
5    branches: [main]
6  pull_request:
7    branches: [main]
8    paths:
9      - '**.rs'
10      - .github/**
11      - Cargo.toml
12
13jobs:
14  test:
15    strategy:
16      matrix:
17        os: [ubuntu-16.04, ubuntu-latest, macos-latest, windows-latest]
18        rust_version: [stable]
19        exhaustive_tz: [onetz]
20        check_combinatoric: [no_combinatoric]
21        include:
22        # check all tzs on most-recent OS's
23        - os: ubuntu-latest
24          rust_version: stable
25          exhaustive_tz: all_tzs
26        - os: windows-latest
27          rust_version: stable
28          exhaustive_tz: all_tzs
29        - os: macos-latest
30          rust_version: stable
31          exhaustive_tz: all_tzs
32        # compilation check
33        - os: ubuntu-latest
34          rust_version: stable
35          check_combinatoric: 'combinatoric'
36        # test other rust versions
37        - os: ubuntu-latest
38          rust_version: beta
39        - os: ubuntu-latest
40          rust_version: nightly
41        - os: ubuntu-16.04
42          rust_version: 1.13.0
43        - os: macos-latest
44          rust_version: 1.13.0
45          # time doesn't work on windows with 1.13
46
47    runs-on: ${{ matrix.os }}
48
49    steps:
50      - uses: actions/checkout@v2
51
52      - name: Install rust
53        uses: actions-rs/toolchain@v1
54        with:
55          toolchain: ${{ matrix.rust_version }}
56          override: true
57
58      - name: Build and Test
59        run: bash ci/github.sh
60        env:
61          RUST_VERSION: ${{ matrix.rust_version }}
62          EXHAUSTIVE_TZ: ${{ matrix.exhaustive_tz }}
63          CHECK_COMBINATORIC: ${{ matrix.check_combinatoric }}
64
65  no_std:
66    strategy:
67      matrix:
68        os: [macos-latest, ubuntu-latest]
69
70    runs-on: ${{ matrix.os }}
71
72    steps:
73      - uses: actions/checkout@v2
74
75      - name: Install rust with no_std toolchain
76        uses: actions-rs/toolchain@v1
77        with:
78          toolchain: stable
79          target: thumbv6m-none-eabi
80          override: true
81
82      - name: Build no_std lib
83        run: cargo build --target thumbv6m-none-eabi --color=always
84        working-directory: ./ci/core-test
85
86  wasm:
87    strategy:
88      matrix:
89        os: [macos-latest]
90
91    runs-on: ${{ matrix.os }}
92
93    steps:
94      - uses: actions/checkout@v2
95
96      - name: Install rust
97        uses: actions-rs/toolchain@v1
98        with:
99          toolchain: stable
100          target: wasm32-unknown-unknown
101          override: true
102
103      - name: Install node
104        uses: actions/setup-node@v1
105        with:
106          node-version: '12'
107
108      - name: Install wasm-pack
109        run: |
110          export RUST_BACKTRACE=1
111          curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
112          wasm-pack --version
113
114      - name: Build and Test
115        run: bash ci/github.sh
116        env:
117          RUST_VERSION: stable
118          WASM: wasm_simple
119
120  cross-targets:
121    strategy:
122      matrix:
123        target:
124          - x86_64-sun-solaris
125
126    runs-on: ubuntu-latest
127    steps:
128      - uses: actions/checkout@v2
129
130      - name: Install cross
131        run: bash ci/install-cross.sh
132
133      - name: Build static library
134        run: cross check --target ${{ matrix.target }}
135