|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "server-*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + check: |
| 10 | + name: check |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Install toolchain |
| 14 | + uses: actions-rs/toolchain@v1 |
| 15 | + with: |
| 16 | + toolchain: nightly |
| 17 | + override: true |
| 18 | + |
| 19 | + - name: Checkout Sources |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Install Protoc |
| 23 | + uses: arduino/setup-protoc@v3 |
| 24 | + with: |
| 25 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + |
| 27 | + - name: Setup cache |
| 28 | + uses: Swatinem/rust-cache@v2 |
| 29 | + |
| 30 | + - name: Install cargo-make |
| 31 | + uses: actions-rs/cargo@v1 |
| 32 | + with: |
| 33 | + command: install |
| 34 | + args: cargo-make |
| 35 | + |
| 36 | + - name: Run check |
| 37 | + run: cargo make check |
| 38 | + |
| 39 | + clippy: |
| 40 | + name: clippy |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - name: Install toolchain |
| 44 | + uses: actions-rs/toolchain@v1 |
| 45 | + with: |
| 46 | + toolchain: nightly |
| 47 | + override: true |
| 48 | + components: clippy |
| 49 | + profile: minimal |
| 50 | + |
| 51 | + - name: Checkout Sources |
| 52 | + uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - name: Install Protoc |
| 55 | + uses: arduino/setup-protoc@v3 |
| 56 | + with: |
| 57 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + |
| 59 | + - name: Setup cache |
| 60 | + uses: Swatinem/rust-cache@v2 |
| 61 | + |
| 62 | + - name: Install cargo-make |
| 63 | + uses: actions-rs/cargo@v1 |
| 64 | + with: |
| 65 | + command: install |
| 66 | + args: cargo-make |
| 67 | + |
| 68 | + - name: Run clippy |
| 69 | + run: cargo make clippy |
| 70 | + |
| 71 | + tests: |
| 72 | + name: tests |
| 73 | + runs-on: ubuntu-latest |
| 74 | + strategy: |
| 75 | + fail-fast: false |
| 76 | + matrix: |
| 77 | + test: [postgres, mysql, mariadb, mssql, unittest] |
| 78 | + steps: |
| 79 | + - name: Install toolchain |
| 80 | + uses: actions-rs/toolchain@v1 |
| 81 | + with: |
| 82 | + toolchain: nightly |
| 83 | + override: true |
| 84 | + profile: minimal |
| 85 | + |
| 86 | + - name: Checkout Sources |
| 87 | + uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Install Protoc |
| 90 | + uses: arduino/setup-protoc@v3 |
| 91 | + with: |
| 92 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 93 | + |
| 94 | + - name: Setup cache |
| 95 | + uses: Swatinem/rust-cache@v2 |
| 96 | + |
| 97 | + - name: Install cargo-make |
| 98 | + uses: actions-rs/cargo@v1 |
| 99 | + with: |
| 100 | + command: install |
| 101 | + args: cargo-make |
| 102 | + |
| 103 | + - name: Tests |
| 104 | + run: cargo make ${{ matrix.test }} |
| 105 | + |
| 106 | + docker: |
| 107 | + needs: [tests, clippy, check] |
| 108 | + name: docker |
| 109 | + runs-on: ubuntu-latest |
| 110 | + steps: |
| 111 | + - name: Checkout Sources |
| 112 | + uses: actions/checkout@v4 |
| 113 | + |
| 114 | + - name: Extract version |
| 115 | + run: echo "VERSION=${GITHUB_REF#refs/tags/server-}" >> $GITHUB_ENV |
| 116 | + |
| 117 | + - name: Login into repository |
| 118 | + uses: docker/login-action@v3 |
| 119 | + with: |
| 120 | + registry: ghcr.io |
| 121 | + username: ${{ github.actor }} |
| 122 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 123 | + |
| 124 | + - name: Build and push Docker image |
| 125 | + uses: docker/build-push-action@v6 |
| 126 | + with: |
| 127 | + context: . |
| 128 | + push: true |
| 129 | + tags: ghcr.io/onelitefeathernet/feedback-fusion:${env.VERSION},ghcr.io/onelitefeathernet/feedback-fusion:latest |
0 commit comments