Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing GitHub Actions Workflows for GH-165 #276

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/lint-and-build-using-make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Copyright 2020 Adam Chalkley
#
# https://github.com/atc0005/elbow
#
# Licensed 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
#
# https://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.

name: Lint and Build using Makefile

# Run builds for Pull Requests (new, updated)
# `synchronized` seems to equate to pushing new commits to a linked branch
# (whether force-pushed or not)
on:
#push:
pull_request:
types: [opened, synchronize]

jobs:
lint_code_with_makefile:
name: Lint codebase using Makefile
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 10
container:
image: "index.docker.io/golang:latest"

steps:
- name: Print go version
run: go version

- name: Check out code into the Go module directory
uses: actions/[email protected]

# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: apt-get update && apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Install Go linting tools
run: make lintinstall

- name: Run Go linting tools using project Makefile
run: make linting

build_code_with_makefile:
name: Build codebase using Makefile
runs-on: ubuntu-latest
# Default: 360 minutes
timeout-minutes: 10
container:
image: "index.docker.io/golang:latest"

steps:
- name: Print go version
run: go version

- name: Check out code into the Go module directory
uses: actions/[email protected]

# bsdmainutils provides "column" which is used by the Makefile
- name: Install Ubuntu packages
run: apt-get update && apt-get install -y --no-install-recommends make gcc bsdmainutils

- name: Build using project Makefile
run: make all
41 changes: 41 additions & 0 deletions .github/workflows/lint-and-test-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2020 Adam Chalkley
#
# https://github.com/atc0005/elbow
#
# Licensed 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
#
# https://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.

name: Quick Validation

# Run builds for Pull Requests (new, updated)
# `synchronized` seems to equate to pushing new commits to a linked branch
# (whether force-pushed or not)
on:
push:

jobs:
lint_and_test_code:
name: Lint and test using latest stable container
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: index.docker.io/atc0005/go-ci:go-ci-lint-only

steps:
- name: Check out code
uses: actions/[email protected]

- name: Run golangci-lint using repo-provided config file settings
run: golangci-lint run -v

- name: Run all tests
run: go test -mod=vendor -v ./...