ci: add basic integration test, pipeline step (#7)
* ci: add basic integration test, pipeline step fix: pull_request trigger fix: env declaration format * ci: hoist env def to step instead of individual run * ci: trigger on main push
This commit is contained in:
parent
5dea83f9a8
commit
096c7b37ef
2 changed files with 41 additions and 0 deletions
20
.github/workflows/ci.yaml
vendored
Normal file
20
.github/workflows/ci.yaml
vendored
Normal file
|
@ -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
|
21
integration/install_specific_version
Normal file
21
integration/install_specific_version
Normal file
|
@ -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
|
Loading…
Reference in a new issue