build
- used to build the whole applicationtest
- used to execute the test cases along with checking the test coveragedeploy
- used to deploy the image of this application to docker hub
CI pipeline defined in this file - pipeline.yaml
DockerHub link of this application - shaikrasheed99/golang-github-actions-example
We can run this application by two ways
-
Make sure your machine has golang installed in it.
- Run the below command to download the code from Github repository to your local machine.
git clone https://github.com/shaikrasheed99/golang-github-actions-example.git
- Run the below command to move to the application directory.
cd golang-github-actions-example/
- Run the below command to install all the dependencies of the application.
go mod tidy
- Run the below command to run the application for testing the APIs.
go run .
- Run the below command to download the code from Github repository to your local machine.
-
Make sure your machine has docker installed in it.
- Run the below command to pull the Image from Dockerhub to your local machine.
docker pull shaikrasheed99/golang-github-actions-example
- The Golang application which inside this image is using port 8080.
- Run the following command in the terminal to start the container.
docker run -d -p 8080:8080 shaikrasheed99/golang-github-actions-example
- Run the below command to pull the Image from Dockerhub to your local machine.
Totally, we have three simple test APIs
Request curl --location --request GET 'http://localhost:8080/test1'
Response "This is first test api"
Request curl --location --request GET 'http://localhost:8080/test2'
Response "This is second test api"
Request curl --location --request GET 'http://localhost:8080/test3'
Response "This is third test api"