|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + check: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + container: |
| 9 | + image: mcr.microsoft.com/cbl-mariner/base/core:2.0 |
| 10 | + steps: |
| 11 | + - name: Install dependencies |
| 12 | + run: unset HOME; tdnf install -y build-essential git openssl-devel ca-certificates |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - uses: actions-rs/toolchain@v1 |
| 15 | + with: |
| 16 | + toolchain: stable |
| 17 | + override: true |
| 18 | + - name: Check format |
| 19 | + run: cargo fmt -- --check |
| 20 | + - name: Run cargo check |
| 21 | + run: cargo check --locked |
| 22 | + - name: Run cargo clippy |
| 23 | + run: cargo clippy -- -D warnings |
| 24 | + |
| 25 | + test: |
| 26 | + runs-on: ubuntu-latest |
| 27 | + container: |
| 28 | + image: mcr.microsoft.com/cbl-mariner/base/core:2.0 |
| 29 | + options: --privileged |
| 30 | + steps: |
| 31 | + - name: Install dependencies |
| 32 | + run: unset HOME; tdnf install -y build-essential git openssl-devel ca-certificates tar helm |
| 33 | + - uses: actions/checkout@v2 |
| 34 | + - uses: actions-rs/toolchain@v1 |
| 35 | + with: |
| 36 | + profile: minimal |
| 37 | + toolchain: stable |
| 38 | + override: true |
| 39 | + - uses: oras-project/setup-oras@v1 |
| 40 | + with: |
| 41 | + version: 1.2.0 |
| 42 | + - name: Run cargo test |
| 43 | + run: cargo test |
| 44 | + |
| 45 | + build: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + container: |
| 48 | + image: mcr.microsoft.com/cbl-mariner/base/core:2.0 |
| 49 | + steps: |
| 50 | + - name: Install dependencies |
| 51 | + run: unset HOME; tdnf install -y build-essential git openssl-devel ca-certificates |
| 52 | + - uses: actions/checkout@v2 |
| 53 | + - uses: actions-rs/toolchain@v1 |
| 54 | + with: |
| 55 | + profile: minimal |
| 56 | + toolchain: stable |
| 57 | + override: true |
| 58 | + - name: Install cargo-generate-rpm |
| 59 | + run: cargo install cargo-generate-rpm |
| 60 | + - name: Build |
| 61 | + run: cargo build --release |
| 62 | + - name: Generate RPM package |
| 63 | + run: cargo generate-rpm |
| 64 | + |
| 65 | + release-dry-run: |
| 66 | + runs-on: ubuntu-latest |
| 67 | + container: |
| 68 | + image: mcr.microsoft.com/cbl-mariner/base/core:2.0 |
| 69 | + steps: |
| 70 | + - name: Install dependencies |
| 71 | + run: unset HOME; tdnf install -y build-essential git openssl-devel ca-certificates |
| 72 | + - uses: actions/checkout@v2 |
| 73 | + - uses: actions-rs/toolchain@v1 |
| 74 | + with: |
| 75 | + profile: minimal |
| 76 | + toolchain: stable |
| 77 | + override: true |
| 78 | + - uses: katyo/publish-crates@v2 |
| 79 | + with: |
| 80 | + dry-run: true |
| 81 | + ignore-unpublished-changes: true |
0 commit comments