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:
Marc 2023-11-05 11:47:24 -05:00 committed by GitHub
parent 5dea83f9a8
commit 096c7b37ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

20
.github/workflows/ci.yaml vendored Normal file
View 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

View 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