Skip to content

Commit

Permalink
Create go.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arnavrneo authored Mar 16, 2024
1 parent ebf553f commit 05afd87
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Action workflow for go server

name: go-apiv1-test

on:
push:
branches: [ "main" ]
paths_ignore:
- 'url-shortener/frontend/'
pull_request:
branches: [ "main" ]
paths_ignore:
- 'url-shortener/frontend/'

workflow_dispatch:


jobs:

build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: url-shortener/servers/go/
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.6'

- name: Set up dependencies
run: go get .

- name: Test
run: |
go test -v ./...
env:
PORT: ${{ secrets.PORT }}
REDIS_URI: ${{ secrets.REDIS_URI }}
REDIS_PASS: ${{ secrets.REDIS_PASS }}
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
DATABASE_COLLECTION: ${{ secrets.DATABASE_COLLECTION }}
SECRET: ${{ secrets.SECRET }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}

0 comments on commit 05afd87

Please sign in to comment.