|
| 1 | +name: "Test unsetting environment variables" |
| 2 | +description: "An end-to-end integration test that unsets some environment variables" |
| 3 | +operatingSystems: ["ubuntu"] |
| 4 | +steps: |
| 5 | + - uses: ./../action/init |
| 6 | + with: |
| 7 | + db-location: ${{ runner.temp }}/customDbLocation |
| 8 | + tools: ${{ steps.prepare-test.outputs.tools-url }} |
| 9 | + env: |
| 10 | + TEST_MODE: true |
| 11 | + - name: Build code |
| 12 | + shell: bash |
| 13 | + run: env -i PATH="$PATH" HOME="$HOME" ./build.sh |
| 14 | + - uses: ./../action/analyze |
| 15 | + id: analysis |
| 16 | + env: |
| 17 | + TEST_MODE: true |
| 18 | + - shell: bash |
| 19 | + run: | |
| 20 | + CPP_DB="${{ fromJson(steps.analysis.outputs.db-locations).cpp }}" |
| 21 | + if [[ ! -d "$CPP_DB" ]] || [[ ! "$CPP_DB" == "${RUNNER_TEMP}/customDbLocation/cpp" ]]; then |
| 22 | + echo "::error::Did not create a database for CPP, or created it in the wrong location." \ |
| 23 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/cpp' but actual was '${CPP_DB}'" |
| 24 | + exit 1 |
| 25 | + fi |
| 26 | + CSHARP_DB="${{ fromJson(steps.analysis.outputs.db-locations).csharp }}" |
| 27 | + if [[ ! -d "$CSHARP_DB" ]] || [[ ! "$CSHARP_DB" == "${RUNNER_TEMP}/customDbLocation/csharp" ]]; then |
| 28 | + echo "::error::Did not create a database for C Sharp, or created it in the wrong location." \ |
| 29 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/csharp' but actual was '${CSHARP_DB}'" |
| 30 | + exit 1 |
| 31 | + fi |
| 32 | + GO_DB="${{ fromJson(steps.analysis.outputs.db-locations).go }}" |
| 33 | + if [[ ! -d "$GO_DB" ]] || [[ ! "$GO_DB" == "${RUNNER_TEMP}/customDbLocation/go" ]]; then |
| 34 | + echo "::error::Did not create a database for Go, or created it in the wrong location." \ |
| 35 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/go' but actual was '${GO_DB}'" |
| 36 | + exit 1 |
| 37 | + fi |
| 38 | + JAVA_DB="${{ fromJson(steps.analysis.outputs.db-locations).java }}" |
| 39 | + if [[ ! -d "$JAVA_DB" ]] || [[ ! "$JAVA_DB" == "${RUNNER_TEMP}/customDbLocation/java" ]]; then |
| 40 | + echo "::error::Did not create a database for Java, or created it in the wrong location." \ |
| 41 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/java' but actual was '${JAVA_DB}'" |
| 42 | + exit 1 |
| 43 | + fi |
| 44 | + JAVASCRIPT_DB="${{ fromJson(steps.analysis.outputs.db-locations).javascript }}" |
| 45 | + if [[ ! -d "$JAVASCRIPT_DB" ]] || [[ ! "$JAVASCRIPT_DB" == "${RUNNER_TEMP}/customDbLocation/javascript" ]]; then |
| 46 | + echo "::error::Did not create a database for Javascript, or created it in the wrong location." \ |
| 47 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/javascript' but actual was '${JAVASCRIPT_DB}'" |
| 48 | + exit 1 |
| 49 | + fi |
| 50 | + PYTHON_DB="${{ fromJson(steps.analysis.outputs.db-locations).python }}" |
| 51 | + if [[ ! -d "$PYTHON_DB" ]] || [[ ! "$PYTHON_DB" == "${RUNNER_TEMP}/customDbLocation/python" ]]; then |
| 52 | + echo "::error::Did not create a database for Python, or created it in the wrong location." \ |
| 53 | + "Expected location was '${RUNNER_TEMP}/customDbLocation/python' but actual was '${PYTHON_DB}'" |
| 54 | + exit 1 |
| 55 | + fi |
0 commit comments