|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ['main', 'v0.1.x'] |
| 6 | + pull_request: |
| 7 | + branches: ['main', 'v0.1.x'] |
| 8 | + schedule: |
| 9 | + - cron: "58 7 * * 3" |
| 10 | + |
| 11 | +jobs: |
| 12 | + fmt: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v3 |
| 17 | + with: |
| 18 | + lfs: true |
| 19 | + |
| 20 | + - name: Setup Rust |
| 21 | + uses: ./.github/actions/setup-rust |
| 22 | + with: |
| 23 | + key: fmt |
| 24 | + toolchain: nightly |
| 25 | + components: rustfmt |
| 26 | + |
| 27 | + - run: cargo +nightly fmt --all -- --check |
| 28 | + |
| 29 | + check: |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + toolchain: |
| 33 | + - "1.55" |
| 34 | + - stable |
| 35 | + - nightly |
| 36 | + |
| 37 | + name: "Check/${{ matrix.toolchain }}" |
| 38 | + runs-on: ubuntu-latest |
| 39 | + steps: |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@v3 |
| 42 | + with: |
| 43 | + lfs: true |
| 44 | + |
| 45 | + - name: Setup Rust |
| 46 | + uses: ./.github/actions/setup-rust |
| 47 | + with: |
| 48 | + key: check |
| 49 | + toolchain: ${{ matrix.toolchain }} |
| 50 | + components: clippy |
| 51 | + |
| 52 | + - name: Check |
| 53 | + run: cargo +${{ matrix.toolchain }} check --package tzdb --all-targets |
| 54 | + |
| 55 | + - name: Lint |
| 56 | + run: cargo +${{ matrix.toolchain }} clippy --package tzdb --all-targets -- -D warnings |
| 57 | + |
| 58 | + test: |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + toolchain: |
| 62 | + - "1.55" |
| 63 | + - stable |
| 64 | + - nightly |
| 65 | + platform: |
| 66 | + - ubuntu-latest |
| 67 | + - windows-latest |
| 68 | + - macos-latest |
| 69 | + |
| 70 | + name: "Test/${{ matrix.toolchain }} (${{ matrix.platform }})" |
| 71 | + runs-on: ${{ matrix.platform }} |
| 72 | + steps: |
| 73 | + - name: Checkout |
| 74 | + uses: actions/checkout@v3 |
| 75 | + with: |
| 76 | + lfs: true |
| 77 | + |
| 78 | + - name: Setup Rust |
| 79 | + uses: ./.github/actions/setup-rust |
| 80 | + with: |
| 81 | + key: test |
| 82 | + toolchain: ${{ matrix.toolchain }} |
| 83 | + |
| 84 | + - name: Test |
| 85 | + run: cargo +${{ matrix.toolchain }} test --package tzdb --all-targets -- --show-output |
| 86 | + |
| 87 | + minimum-versions: |
| 88 | + name: "Minimal versions" |
| 89 | + runs-on: ubuntu-latest |
| 90 | + steps: |
| 91 | + - name: Checkout |
| 92 | + uses: actions/checkout@v3 |
| 93 | + with: |
| 94 | + lfs: true |
| 95 | + |
| 96 | + - name: Setup Rust |
| 97 | + uses: ./.github/actions/setup-rust |
| 98 | + with: |
| 99 | + key: minimum-versions |
| 100 | + toolchain: nightly |
| 101 | + |
| 102 | + - name: Update lockfile |
| 103 | + run: cargo generate-lockfile -Zminimal-versions |
| 104 | + |
| 105 | + - name: Test |
| 106 | + run: cargo +nightly test --all-targets -- --show-output |
| 107 | + |
| 108 | + miri: |
| 109 | + name: "Miri" |
| 110 | + runs-on: ubuntu-latest |
| 111 | + steps: |
| 112 | + - name: Checkout |
| 113 | + uses: actions/checkout@v3 |
| 114 | + with: |
| 115 | + lfs: true |
| 116 | + |
| 117 | + - name: Setup Rust |
| 118 | + uses: ./.github/actions/setup-rust |
| 119 | + with: |
| 120 | + key: miri |
| 121 | + toolchain: nightly |
| 122 | + components: miri |
| 123 | + |
| 124 | + - name: Test |
| 125 | + run: cargo +nightly miri test --package tzdb --all-targets -- --show-output |
| 126 | + |
| 127 | + doc: |
| 128 | + name: "Documentation" |
| 129 | + runs-on: ubuntu-latest |
| 130 | + steps: |
| 131 | + - name: Checkout |
| 132 | + uses: actions/checkout@v3 |
| 133 | + with: |
| 134 | + lfs: true |
| 135 | + |
| 136 | + - name: Setup Rust |
| 137 | + uses: ./.github/actions/setup-rust |
| 138 | + with: |
| 139 | + key: name |
| 140 | + toolchain: nightly |
| 141 | + components: rust-docs |
| 142 | + |
| 143 | + - run: RUSTDOCFLAGS="-D warnings" cargo +nightly doc --package tzdb --features docsrs --all-features --no-deps |
| 144 | + |
| 145 | + audit: |
| 146 | + name: "Cargo audit" |
| 147 | + runs-on: ubuntu-latest |
| 148 | + steps: |
| 149 | + - name: Checkout |
| 150 | + uses: actions/checkout@v3 |
| 151 | + with: |
| 152 | + lfs: true |
| 153 | + |
| 154 | + - name: Setup Rust |
| 155 | + uses: ./.github/actions/setup-rust |
| 156 | + with: |
| 157 | + key: audit |
| 158 | + |
| 159 | + - run: cargo update |
| 160 | + |
| 161 | + - name: Audit |
| 162 | + uses: actions-rs/audit-check@v1 |
| 163 | + with: |
| 164 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 165 | + |
| 166 | + powerset: |
| 167 | + strategy: |
| 168 | + matrix: |
| 169 | + toolchain: |
| 170 | + - "1.55" |
| 171 | + - stable |
| 172 | + - nightly |
| 173 | + platform: |
| 174 | + - ubuntu-latest |
| 175 | + |
| 176 | + name: "Feature powerset/${{ matrix.toolchain }} (${{ matrix.platform }})" |
| 177 | + runs-on: ubuntu-latest |
| 178 | + steps: |
| 179 | + - name: Checkout |
| 180 | + uses: actions/checkout@v3 |
| 181 | + with: |
| 182 | + lfs: true |
| 183 | + |
| 184 | + - name: Setup Rust |
| 185 | + uses: ./.github/actions/setup-rust |
| 186 | + with: |
| 187 | + key: powerset |
| 188 | + toolchain: ${{ matrix.toolchain }} |
| 189 | + |
| 190 | + - name: Install hack |
| 191 | + run: cargo +stable install cargo-hack --force |
| 192 | + |
| 193 | + - name: Powerset |
| 194 | + run: cargo +${{ matrix.toolchain }} hack test --feature-powerset --exclude-features docsrs --ignore-private --tests --lib |
0 commit comments