Do not gitignore artifacts #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libssl-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check code format | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run tests | |
| run: cargo test --verbose | |
| build-matrix: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| # os: [ubuntu-latest, macos-latest] | |
| rust: [stable, nightly] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake libssl-dev | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install cmake | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run tests | |
| run: cargo test --verbose | |
| # benchmark: | |
| # name: Benchmark | |
| # runs-on: ubuntu-latest | |
| # needs: test | |
| # if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| # steps: | |
| # - uses: actions/checkout@v3 | |
| # - name: Install dependencies | |
| # run: | | |
| # sudo apt-get update | |
| # sudo apt-get install -y build-essential cmake libssl-dev | |
| # - name: Install Rust | |
| # uses: dtolnay/rust-toolchain@stable | |
| # - name: Cache dependencies | |
| # uses: Swatinem/rust-cache@v2 | |
| # - name: Run benchmarks | |
| # run: cargo bench |