feat: add ci pipeline for testing gin-mongo native #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Stage | ||
on: | ||
workflow_call: | ||
outputs: | ||
test_status: | ||
description: "Exit status of the test script" | ||
value: ${{ jobs.test-go-mongo.outputs.test_result }} | ||
jobs: | ||
test-go-mongo: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
test_result: ${{ steps.test_script.outcome }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Download Keploy Build Binary | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: keploy-binary | ||
path: /usr/local/bin | ||
- name: Giving permission to binary | ||
run: | | ||
sudo chmod +x /usr/local/bin/kTestBuild | ||
- name: Download the latest released binary of keploy | ||
run: | | ||
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz" | tar xz -C /tmp | ||
sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin/kRecordHosted | ||
## Get the pilot for tests and mocks assertion | ||
- name: Download the latest version of pilot | ||
run: | | ||
curl --silent -o pilot --location "https://github.com/keploy/pilot/releases/latest/download/pilot_linux_amd64" && | ||
sudo chmod a+x pilot && sudo mkdir -p /usr/local/bin && sudo mv pilot /usr/local/bin | ||
- name: Checkout the samples-go repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: keploy/samples-go | ||
path: samples-go | ||
- name: Run samples-go application | ||
id: test_script | ||
run: | | ||
cd samples-go/gin-mongo | ||
chmod +x ./../../.github/workflows/test-bench-workflow-scripts/mongo/go-mongo-linux-1.sh | ||
./../../.github/workflows/test-bench-workflow-scripts/mongo/go-mongo-linux-1.sh | ||
echo "::set-output name=outcome::${?}" |