Update go.yml #11
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
# 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: | |
env: | |
PORT: ${{ secrets.PORT }} | |
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: Set env vars | |
# run: | | |
# export PORT=${{ secrets.PORT }} | |
# export REDIS_URI=${{ secrets.REDIS_URI }} | |
# export REDIS_PASS=${{ secrets.REDIS_PASS }} | |
# export SECRET=${{ secrets.SECRET }} | |
# export MONGODB_URI=${{ secrets.MONGODB_URI }} | |
# export DATABASE_COLLECTION=${{ secrets.DATABASE_COLLECTION }} | |
# export DATABASE_NAME=${{ secrets.DATABASE_NAME }} | |
- name: Test | |
run: go test -v ./... | |
- name: Environment list | |
run: env |