Skip to content

Commit

Permalink
Work on the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-mysten committed Oct 18, 2024
1 parent a36ac07 commit 7384785
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ permissions:

env:
RUSTFLAGS: -Dwarnings
SUI_BINARY_VERSION: "1.35.1" # used for downloading a specific Sui binary versions that matches the GraphQL schema for local network tests

jobs:
test:
Expand Down Expand Up @@ -46,20 +45,6 @@ jobs:
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-nextest

- name: Check if the schema file was modified but not the version needed for the Sui CLI binary
run: |
# we need to keep the version of the Sui binary to be the same as when this schema made it into testnet
# to do so we check if the schema file changed, and if the workflow file changed. If it did not, then error
SCHEMA_FILE_CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q 'crates/sui-graphql-client/schema/graphql_rpc.graphql' && echo "true" || echo "false")
WORKFLOW_CHANGED=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -q '.github/workflows/ci.yml' && echo "true" || echo "false")
echo $SCHEMA_FILE_CHANGED
echo $WORKFLOW_CHANGED
if [ "$SCHEMA_FILE_CHANGED" = "true" ] && [ "$WORKFLOW_CHANGED" = "false" ]; then
echo "If you changed the GraphQL schema, make sure you set the correct Sui SUI_BINARY_VERSION the workflow file. This version should be the one at which this schema was deployed to testnet network."
exit 1
fi
- name: feature compatibility
run: make check-features

Expand All @@ -85,15 +70,15 @@ jobs:
- name: Get the latest Sui testnet binary and start a local network
shell: bash
env:
SUI_BINARY_VERSION: "1.35.1" # used for downloading a specific Sui binary versions that matches the GraphQL schema for local network tests
run: |
os=${{runner.os}}
binary_os=""
if [ $os == "Linux" ]; then
binary_os="ubuntu"
fi
# We need to set the exact binary version that corresponds to the schema used in this repository
# If you update schema, then you need to update this SUI_BINARY_VERSION as well
testnet_url=$(cat releases.json | jq --arg os $binary_os --arg version $SUI_BINARY_VERSION '.[] | .assets[] | select(.name | contains("testnet")) | select(.name | contains($os)) | select(.name | contains("x86")) | select(.name | contains($version))'| jq -csr '.[0] | .browser_download_url')
filename="sui-$binary_os.tar.gz"
echo "Downloading testnet binary from $testnet_url"
Expand Down

0 comments on commit 7384785

Please sign in to comment.