Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: quarylabs/sqruff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.13
Choose a base ref
...
head repository: quarylabs/sqruff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.0.14
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Apr 15, 2024

  1. feat: adding ci check to check versions match

    benfdking committed Apr 15, 2024
    Copy the full SHA
    e9b3828 View commit details
  2. fix: release versioning check

    benfdking committed Apr 15, 2024
    Copy the full SHA
    e1a3162 View commit details
Showing with 57 additions and 5 deletions.
  1. +10 −0 .github/workflows/pr.yaml
  2. +16 −0 .github/workflows/release.yml
  3. +26 −0 .hacking/check_versions_match.sh
  4. +2 −2 Cargo.lock
  5. +2 −2 crates/cli/Cargo.toml
  6. +1 −1 crates/lib/Cargo.toml
10 changes: 10 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -8,6 +8,16 @@ env:
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
jobs:
check-versions-match:
name: Check versions match
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
- name: Allow running check_versions_match.sh
run: chmod +x ./.hacking/check_versions_match.sh
- run: ./.hacking/check_versions_match.sh
compile:
name: Compile
runs-on: ubuntu-latest
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -4,9 +4,25 @@ on:
- "v*.*.*"

jobs:
check-versions-match:
name: Check versions match
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
- name: Allow running check_versions_match.sh
run: chmod +x ./.hacking/check_versions_match.sh
- name: Check release version matches code
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
STRIPPED_VERSION=${RELEASE_VERSION#v}
./.hacking/check_versions_match.sh $STRIPPED_VERSION
release:
name: Release ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.os }}
needs:
- check-versions-match
strategy:
fail-fast: false
matrix:
26 changes: 26 additions & 0 deletions .hacking/check_versions_match.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -eo pipefail

# Extract version from Cargo.toml
cargo_version_cli=$(grep "^version" crates/cli/Cargo.toml | awk -F '"' '{print $2}')
cargo_version_lib=$(grep "^version" crates/lib/Cargo.toml | awk -F '"' '{print $2}')

# Optional GitHub release version passed as an argument
github_release_version=$1

# Function to compare two versions
compare_versions() {
if [ "$1" != "$2" ]; then
echo "Versions do not match: $1 vs $2"
exit 1
fi
}

compare_versions "$cargo_version_cli" "$cargo_version_lib"

# If GitHub release version is provided, compare it as well
if [ -n "$github_release_version" ]; then
compare_versions "$cargo_version_cli" "$github_release_version"
fi

echo "Versions match."
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sqruff"
description = "A high-speed SQL linter."
version = "0.1.4"
version = "0.0.14"
edition = "2021"
license = "MIT"

@@ -13,7 +13,7 @@ harness = false
jemalloc = ["jemallocator"]

[dependencies]
sqruff-lib = { version = "0.1.4", path = "../lib" }
sqruff-lib = { version = "0.0.14", path = "../lib" }
clap = { version = "4", features = ["derive"] }
console = "0.15.8"

2 changes: 1 addition & 1 deletion crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sqruff-lib"
description = "A high-speed SQL linter."
version = "0.1.4"
version = "0.0.14"
edition = "2021"
license = "MIT"