Skip to content

Commit

Permalink
ci(build): extract version from cargo-metadata
Browse files Browse the repository at this point in the history
Avoids this issue

```
Error: Cannot downgrade from 24.7.0 to 0.0.0-pr602
```
  • Loading branch information
NickLarsenNZ committed Jul 25, 2024
1 parent 11c52d3 commit 878432c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ jobs:
bin: cargo-set-version
- name: Update version if PR
if: ${{ github.event_name == 'pull_request' }}
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
run: |
VERSION=$(cargo metadata --format-version=1 | jq -r '.workspace_members[] | match("operator@(.*)$").captures[0].string')
cargo set-version --offline --workspace "${VERSION}-pr${{ github.event.pull_request.number }}"
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
Expand Down Expand Up @@ -410,7 +412,9 @@ jobs:
bin: cargo-set-version
- name: Update version if PR
if: ${{ github.event_name == 'pull_request' }}
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
run: |
VERSION=$(cargo metadata --format-version=1 | jq -r '.workspace_members[] | match("operator@(.*)$").captures[0].string')
cargo set-version --offline --workspace "${VERSION}-pr${{ github.event.pull_request.number }}"
- name: Build manifest list
run: |
# Creating manifest list
Expand Down
4 changes: 2 additions & 2 deletions scripts/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Examples:
./scripts/run-tests --parallel 4
2. Install operators but for Airflow use version "0.0.0-pr123" instead of "0.0.0-dev" and run all tests as above:
2. Install operators but for Airflow use version "0.0.0-dev-pr123" instead of "0.0.0-dev" and run all tests as above:
./scripts/run-tests --operator airflow=0.0.0-pr123 --parallel 4
./scripts/run-tests --operator airflow=0.0.0-dev-pr123 --parallel 4
3. Do not install any operators, run the smoke test suite and keep namespace:
Expand Down

0 comments on commit 878432c

Please sign in to comment.