Skip to content

Update dependency

Update dependency #60

Workflow file for this run

name: Test
on:
push:
tags:
- v*
# branches:
# - master
pull_request:
branches: [ master ]
jobs:
# releases-matrix:
# name: Release Matrix
# runs-on: ubuntu-latest
# strategy:
# matrix:
# goos: [ linux ]
# goarch: [ amd64 ]
# exclude:
# # windows/arm64 seems useless
# - goarch: arm64
# goos: windows
build:
name: Test-Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Setup environment
run: |
echo APP_VERSION=$(basename ${GITHUB_REF}) >> $GITHUB_ENV
echo BUILD_TIME=$(date -u +"%Y%m%d-%H:%M:%S") >> $GITHUB_ENV
echo BUILD_USER=$(echo ${GITHUB_ACTOR}@${HOSTNAME}) >> $GITHUB_ENV
# - name: Setup environment II
# run: |
# echo BUILD_ARTIFACTS_FOLDER=$(echo build-artifacts-$(date +%s)) >> $GITHUB_ENV
# echo BINARY_NAME=$(basename ${GITHUB_REPOSITORY}) >> $GITHUB_ENV
# echo GOOS=$(echo ${{ matrix.goos }}) >> $GITHUB_ENV
# echo GOARCH=$(echo ${{ matrix.goarch }}) >> $GITHUB_ENV
# if [ ${GOOS} == 'windows' ]; then
# echo BINARY_EXT='.exe' >> $GITHUB_ENV
# echo RELEASE_ASSET_EXT='.zip' >> $GITHUB_ENV
# echo MEDIA_TYPE='application/zip' >> $GITHUB_ENV
# else
# echo BINARY_EXT='' >> $GITHUB_ENV
# echo RELEASE_ASSET_EXT='.tar.gz' >> $GITHUB_ENV
# echo MEDIA_TYPE='application/gzip' >> $GITHUB_ENV
# fi
# - name: Set asset name
# run: echo RELEASE_ASSET_NAME=$(echo ${{ env.BINARY_NAME }}-${{ env.APP_VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}) >> $GITHUB_ENV
- name: Environment Printer
uses: managedkaos/[email protected]
- name: Build
run: go build -v -ldflags="-X 'main.Version=${{ env.APP_VERSION }}' -X 'main.BuildDate=${{ env.BUILD_TIME }}' -X 'main.Branch=${{ github.ref }}' -X 'main.Revision=${{ github.SHA }}' -X 'main.BuildUser=${{ env.BUILD_USER }}'" .
- name: Test
run: go test -v .
- name: Show Data
run: ./cucm_performance_exporter --version
# - name: Create directory
# run: |
# mkdir -p ${BUILD_ARTIFACTS_FOLDER}
# cp -r LICENSE README.md config.yml ${{ env.BUILD_ARTIFACTS_FOLDER }}/
#
# - name: Build
# run: go build -v -o "${{ env.BUILD_ARTIFACTS_FOLDER }}/${{ env.BINARY_NAME }}${{ env.BINARY_EXT }}" -ldflags="-X 'main.Version=${{ env.APP_VERSION }}' -X 'main.BuildDate=${{ env.BUILD_TIME }}' -X 'main.Branch=${{ github.ref }}' -X 'main.Revision=${{ github.SHA }}' -X 'main.BuildUser=${{ env.BUILD_USER }}'" .
#
# - name: List files in directory
# run: ls -lha ${{ env.BUILD_ARTIFACTS_FOLDER }}/
#
# - name: TAR/ZIP files
# run: |
# cd ${{ env.BUILD_ARTIFACTS_FOLDER }}
#
# if [ ${GOOS} == 'windows' ]; then
# zip -vr ${{ env.RELEASE_ASSET_NAME }}${{ env.RELEASE_ASSET_EXT }} *
# else
# tar cvfz ${{ env.RELEASE_ASSET_NAME }}${{ env.RELEASE_ASSET_EXT }} *
# fi
# id: create_tar
#
# - name: List files in directory
# run: |
# ls -lha ${{ env.BUILD_ARTIFACTS_FOLDER }}/