|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
1 | 18 | name: Rust |
2 | 19 |
|
3 | 20 | on: [push, pull_request] |
|
10 | 27 | - uses: actions/checkout@v4 |
11 | 28 | - name: Setup Rust Toolchain |
12 | 29 | uses: ./.github/actions/setup-builder |
13 | | - with: |
14 | | - # Note that `nightly` is required for `license_template_path`, as |
15 | | - # it's an unstable feature. |
16 | | - rust-version: nightly |
17 | | - - run: cargo +nightly fmt -- --check --config-path <(echo 'license_template_path = "HEADER"') |
| 30 | + - run: cargo fmt -- --check |
18 | 31 |
|
19 | 32 | lint: |
20 | 33 | runs-on: ubuntu-latest |
|
72 | 85 | use-tool-cache: true |
73 | 86 | - name: Test |
74 | 87 | run: cargo test --all-features |
75 | | - |
76 | | - test-coverage: |
77 | | - runs-on: ubuntu-latest |
78 | | - steps: |
79 | | - - name: Checkout |
80 | | - uses: actions/checkout@v4 |
81 | | - - name: Setup Rust Toolchain |
82 | | - uses: ./.github/actions/setup-builder |
83 | | - with: |
84 | | - rust-version: stable |
85 | | - - name: Install Tarpaulin |
86 | | - uses: actions-rs/install@v0.1 |
87 | | - with: |
88 | | - crate: cargo-tarpaulin |
89 | | - version: 0.14.2 |
90 | | - use-tool-cache: true |
91 | | - - name: Coverage |
92 | | - run: cargo tarpaulin -o Lcov --output-dir ./coverage |
93 | | - - name: Coveralls |
94 | | - uses: coverallsapp/github-action@master |
95 | | - with: |
96 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
97 | | - |
98 | | - publish-crate: |
99 | | - if: startsWith(github.ref, 'refs/tags/v0') |
100 | | - runs-on: ubuntu-latest |
101 | | - needs: [test] |
102 | | - steps: |
103 | | - - uses: actions/checkout@v4 |
104 | | - - name: Setup Rust Toolchain |
105 | | - uses: ./.github/actions/setup-builder |
106 | | - - name: Publish |
107 | | - shell: bash |
108 | | - run: | |
109 | | - cargo publish --token ${{ secrets.CRATES_TOKEN }} |
0 commit comments