blob: 1c7c3c079d5330011fb27d8b892beaac064f1e20 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# To learn more about GitHub Actions in Apache Beam check the CI.md
name: Tour of Beam Go unittests
on:
push:
branches: ['master', 'release-*']
tags: 'v*'
paths: ['learning/tour-of-beam/backend/**']
pull_request:
branches: ['master', 'release-*']
tags: 'v*'
paths: ['learning/tour-of-beam/backend/**']
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.issue.number || github.event.pull_request.head.label || github.sha || github.head_ref || github.ref }}-${{ github.event.schedule || github.event.comment.id || github.event.sender.login}}'
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./learning/tour-of-beam/backend
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-go@v7
with:
# Pin to the biggest Go version supported by Cloud Run functions runtime
# Verify here - https://docs.cloud.google.com/functions/docs/release-notes
go-version: '1.26'
cache: false
- name: Run fmt
run: |
go fmt ./...
git diff-index --quiet HEAD || (echo "Run go fmt before checking in changes" && exit 1)
- name: Run vet
run: go vet ./...
- name: Run test
run: go test -v ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
working-directory: learning/tour-of-beam/backend