diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 211e97c..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Linux Build + Tests - -on: - push: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build-linux: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build - run: cargo build - - uses: taiki-e/install-action@nextest - - name: Populate test graph - run: pip install falkordb && ./resources/populate_graph.py - - name: Test - run: cargo nextest run --all - services: - falkordb: - image: falkordb/falkordb:edge - ports: - - 6379:6379 \ No newline at end of file diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 6c89c39..0000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Code Coverage - -on: - push: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - coverage: - runs-on: linux-latest - steps: - - uses: actions/checkout@v4 - - name: Populate test graph - run: pip install falkordb && ./resources/populate_graph.py - - uses: taiki-e/install-action@cargo-llvm-cov - - uses: taiki-e/install-action@nextest - - name: Generate Code Coverage - run: cargo llvm-cov nextest --all --codecov --output-path codecov.json - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: codecov.json - fail_ci_if_error: true - services: - falkordb: - image: falkordb/falkordb:edge - ports: - - 6379:6379 \ No newline at end of file diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index f3c21d1..0000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Documentation - -on: - push: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - doc: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Doc - run: cargo doc --all \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/main.yml similarity index 53% rename from .github/workflows/release.yml rename to .github/workflows/main.yml index 03cdc36..9d9bc3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,13 @@ name: Publish on crates.io +permissions: + pull-requests: write + contents: write + on: push: - tags: [ '*' ] + branches: + - main env: CARGO_TERM_COLOR: always @@ -16,13 +21,6 @@ jobs: - name: Check Rustfmt run: cargo fmt --all --check - # Make sure no unwanted licenses or yanked crates have slipped in - deny: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: EmbarkStudios/cargo-deny-action@v1 - # Make sure the release's build works build: runs-on: ubuntu-latest @@ -30,11 +28,26 @@ jobs: - uses: actions/checkout@v4 - name: Build run: cargo build - - uses: taiki-e/install-action@nextest + + # Generate code coverage using llvm cov + coverage: + needs: + - build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - name: Populate test graph run: pip install falkordb && ./resources/populate_graph.py - - name: Test - run: cargo nextest run --all + - uses: taiki-e/install-action@cargo-llvm-cov + - uses: taiki-e/install-action@nextest + - name: Generate Code Coverage + run: cargo llvm-cov nextest --all --codecov --output-path codecov.json + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} # Must be manually set + files: codecov.json + fail_ci_if_error: true services: falkordb: image: falkordb/falkordb:edge @@ -57,27 +70,38 @@ jobs: - name: Doc run: cargo doc --all + # Make sure no unwanted licenses or yanked crates have slipped in + deny: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: EmbarkStudios/cargo-deny-action@v1 + # Actually publish to crates.io crates-io: needs: - fmt - - deny - build + - coverage - clippy - doc + - deny runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install Cargo Release - run: cargo install cargo-release - - name: Login - run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} - - name: Publish - run: |- - cargo release \ - publish \ - --all-features \ - --allow-branch HEAD \ - --no-confirm \ - --no-verify \ - --execute \ No newline at end of file + with: + fetch-depth: 0 # Release-plz needs all the history + + - name: Verify main branch + if: github.ref != 'refs/heads/main' + run: | + echo "This workflow can only run on the main branch." + exit 1 + + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + with: + command: release-pr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically generated by Github Actions + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} # Must be manually set \ No newline at end of file diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 8520c82..8d2ea94 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -35,12 +35,19 @@ jobs: - name: Check Rustfmt run: cargo fmt --all --check - build-linux: + check-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build run: cargo build + + check-tests: + needs: + - check-build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - uses: taiki-e/install-action@nextest - name: Populate test graph run: pip install falkordb && ./resources/populate_graph.py diff --git a/README.md b/README.md index e8e5973..05899ef 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![license](https://img.shields.io/github/license/falkordb/falkordb-rs.svg)](https://github.com/falkordb/falkordb-rs) +[![license](https://img.shields.io/badge/license-SSPL--1.0-green)](https://github.com/FalkorDB/falkordb-rs?tab=License-1-ov-file) [![Release](https://img.shields.io/github/release/falkordb/falkordb-rs.svg)](https://github.com/falkordb/falkordb-rs/releases/latest) [![Codecov](https://codecov.io/gh/falkordb/falkordb-rs/branch/main/graph/badge.svg)](https://codecov.io/gh/falkordb/falkordb-rs) -[![Docs](https://img.shields.io/docsrs/:crate)](https://docs.rs/crate/falkordb/0.1.0)\ +[![Docs](https://img.shields.io/docsrs/falkordb)](https://docs.rs/crate/falkordb)\ [![Forum](https://img.shields.io/badge/Forum-falkordb-blue)](https://github.com/orgs/FalkorDB/discussions) [![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.gg/ErBEqN9E) diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000..f581c18 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,2 @@ +[workspace] +semver_check = false # disable API breaking changes checks, I suggest this becomes 'true' after we release 1.0