diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml deleted file mode 100644 index c7b7d624..00000000 --- a/.github/workflows/build-and-test.yaml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build and test - -on: - workflow_call: - -jobs: - build: - name: Build Ratings - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - - - name: Install build dependencies - run: | - sudo apt-get update - sudo apt-get install -y libssl-dev pkg-config protobuf-compiler - - - name: Check code formating - uses: mbrobbel/rustfmt-check@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Clippy linting - uses: giraffate/clippy-action@v1 - with: - reporter: "github-pr-review" - github_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Dependencies security audit - uses: actions-rust-lang/audit@v1 - with: - ignore: RUSTSEC-2023-0071 # patch not available att - - - name: Setup and Run Tests - run: | - cargo install cargo-make - cargo install dotenvy --features=cli - cargo make full-test diff --git a/.github/workflows/check-build-publish.yaml b/.github/workflows/ci.yaml similarity index 60% rename from .github/workflows/check-build-publish.yaml rename to .github/workflows/ci.yaml index a4e98de6..36aad501 100644 --- a/.github/workflows/check-build-publish.yaml +++ b/.github/workflows/ci.yaml @@ -1,34 +1,58 @@ -name: Check, build and publish +name: CI on: push: branches: - main -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + pull_request: + branches: + - main + + workflow_dispatch: jobs: - checks: - name: Test and lint - runs-on: ubuntu-22.04 - permissions: - checks: write + build: + name: Build Ratings + runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y libssl-dev pkg-config protobuf-compiler libprotobuf-dev + sudo apt-get install -y libssl-dev pkg-config protobuf-compiler - - name: Checkout code - uses: actions/checkout@v4 + - name: Check code formating + uses: mbrobbel/rustfmt-check@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Clippy linting + uses: giraffate/clippy-action@v1 + with: + reporter: "github-pr-review" + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Dependencies security audit + uses: actions-rust-lang/audit@v1 + with: + ignore: RUSTSEC-2023-0071 # patch not available att - - name: Test and lint code - uses: ./.github/workflows/build-and-test.yaml + - name: Setup and Run Tests + run: | + cargo install cargo-make + cargo install dotenvy --features=cli + cargo make full-test publish: + if: github.event_name == 'push' name: Publish to ghcr.io + needs: build runs-on: ubuntu-22.04 permissions: contents: read diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 5d323869..7924b097 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -8,8 +8,6 @@ concurrency: cancel-in-progress: true jobs: - build: - uses: ./.github/workflows/build-and-test.yaml cla: uses: ./.github/workflows/cla.yaml style-lints: