1on:
2  push:
3    branches: [staging, trying]
4  pull_request:
5
6name: Test
7
8jobs:
9  tests:
10    runs-on: ubuntu-22.04
11    needs: [test, check]
12    steps:
13      - name: Done
14        run: exit 0
15  test:
16    runs-on: ubuntu-22.04
17    continue-on-error: ${{ matrix.rust == 'nightly' }}
18    strategy:
19      matrix:
20        # Test on stable, MSRV, and nightly.
21        # Failure is permitted on nightly.
22        rust:
23          #- stable  # TODO: enable again when "stable" is 1.66 or higher.
24          - 1.65.0
25          - nightly
26
27        features:
28          # Test default features.
29          - default
30
31          # Test minimal featureset
32          - std proto-ipv4
33
34          # Test features chosen to be as orthogonal as possible.
35          - std medium-ethernet phy-raw_socket proto-ipv6 socket-udp socket-dns
36          - std medium-ethernet phy-tuntap_interface proto-ipv6 socket-udp
37          - std medium-ethernet proto-ipv4 proto-ipv4-fragmentation socket-raw socket-dns
38          - std medium-ethernet proto-ipv4 proto-igmp socket-raw socket-dns
39          - std medium-ethernet proto-ipv4 socket-udp socket-tcp socket-dns
40          - std medium-ethernet proto-ipv4 proto-dhcpv4 socket-udp
41          - std medium-ethernet medium-ip medium-ieee802154 proto-ipv6 socket-udp socket-dns
42          - std medium-ethernet proto-ipv6 socket-tcp
43          - std medium-ethernet medium-ip proto-ipv4 socket-icmp socket-tcp
44          - std medium-ip proto-ipv6 socket-icmp socket-tcp
45          - std medium-ieee802154 proto-sixlowpan socket-udp
46          - std medium-ieee802154 proto-sixlowpan proto-sixlowpan-fragmentation socket-udp
47          - std medium-ip proto-ipv4 proto-ipv6 socket-tcp socket-udp
48
49          # Test features chosen to be as aggressive as possible.
50          - std medium-ethernet medium-ip medium-ieee802154 proto-ipv4 proto-ipv6 socket-raw socket-udp socket-tcp socket-icmp socket-dns async
51
52        include:
53          # Test alloc feature which requires nightly.
54          - rust: nightly
55            features: alloc medium-ethernet proto-ipv4 proto-ipv6 socket-raw socket-udp socket-tcp socket-icmp
56    env:
57      RUSTUP_TOOLCHAIN: "${{ matrix.rust }}"
58    steps:
59      - uses: actions/checkout@v2
60      - name: Run Tests
61        run: cargo test --no-default-features --features "${{ matrix.features }}"
62
63  check:
64    runs-on: ubuntu-22.04
65    continue-on-error: ${{ matrix.rust == 'nightly' }}
66    strategy:
67      matrix:
68        # Test on stable, MSRV, and nightly.
69        # Failure is permitted on nightly.
70        rust:
71          #- stable  # TODO: enable again when "stable" is 1.66 or higher.
72          - 1.65.0
73          - nightly
74
75        features:
76          # These feature sets cannot run tests, so we only check they build.
77          - medium-ip medium-ethernet medium-ieee802154 proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp socket-dns async
78          - defmt medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp socket-dns async
79          - defmt alloc medium-ip medium-ethernet proto-ipv6 proto-ipv6 proto-igmp proto-dhcpv4 socket-raw socket-udp socket-tcp socket-icmp socket-dns async
80
81    env:
82      # Set DEFMT_LOG to trace so that all net_{error, .., trace} messages
83      # are actually compiled and verified
84      DEFMT_LOG: "trace"
85      RUSTUP_TOOLCHAIN: "${{ matrix.rust }}"
86    steps:
87      - uses: actions/checkout@v2
88      - name: Check
89        run: cargo check --no-default-features --features "${{ matrix.features }}"
90