diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..baa674c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,20 @@ +name: "v CI/CD" + +on: + pull_request: + push: + branches: + - main + +jobs: + integration-tests: + name: "Integration tests" + runs-on: ubuntu-latest + env: + V_ROOT: /tmp/v + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + - run: . integration/install_specific_version diff --git a/integration/install_specific_version b/integration/install_specific_version new file mode 100644 index 0000000..2fa29cb --- /dev/null +++ b/integration/install_specific_version @@ -0,0 +1,21 @@ +#!/bin/bash + +# Scenario: User installs a specific version of python. + +echo "Scenario: User installs a specific version of Python" + +go build . + +TARGET_VERSION="3.10.0" + +V_ROOT=/tmp/v ./v init +V_ROOT=/tmp/v ./v install $TARGET_VERSION --no-cache + +INSTALLED_VERSIONS=$(V_ROOT=/tmp/v ./v ls) + +if [ -z "$(echo $INSTALLED_VERSIONS | grep $TARGET_VERSION)" ]; then + echo "FAIL: Could not find target version." + exit 1 +else + echo "SUCCESS" +fi