Skip to content

Merge pull request #47 from kaovilai/fixAzureTest-nosuchhosts #99

Merge pull request #47 from kaovilai/fixAzureTest-nosuchhosts

Merge pull request #47 from kaovilai/fixAzureTest-nosuchhosts #99

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
BUILDTAGS: include_gcs include_oss
steps:
- uses: actions/checkout@v3
- name: pre-req gpgme
run: sudo apt-get install libgpgme11 libgpgme-dev
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Build
run: go build -tags "${{ env.BUILDTAGS }}" -v ./...
- name: Test
run: |
# enable e2e
export UDISTRIBUTION_TEST_E2E_ENABLE=${{ secrets.UDISTRIBUTION_TEST_E2E_ENABLE }}
# set env vars from secrets
export REGISTRY_STORAGE=${{ secrets.REGISTRY_STORAGE }}
export REGISTRY_STORAGE_S3_BUCKET=${{ secrets.REGISTRY_STORAGE_S3_BUCKET }}
export REGISTRY_STORAGE_S3_ACCESSKEY=${{ secrets.REGISTRY_STORAGE_S3_ACCESSKEY }}
export REGISTRY_STORAGE_S3_SECRETKEY=${{ secrets.REGISTRY_STORAGE_S3_SECRETKEY }}
export REGISTRY_STORAGE_S3_REGION=${{ secrets.REGISTRY_STORAGE_S3_REGION }}
# start tests
make test
- uses: codecov/codecov-action@v2
format:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- run: go mod tidy
- name: Go mod is tidy
run: |
git diff --exit-code go.mod go.sum
- name: Format
run: go fmt ./...
- name: commit format
uses: EndBug/[email protected]
with:
message: 'go fmt ./... from Github Actions (Go)'