Skip to content

Commit

Permalink
Merge pull request #276 from atc0005/i165-add-missing-workflows
Browse files Browse the repository at this point in the history
Add missing GitHub Actions Workflows for GH-165
  • Loading branch information
atc0005 authored Aug 3, 2020
2 parents 71db243 + 16317ef commit 587644f
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 0 deletions.
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 ./...

0 comments on commit 587644f

Please sign in to comment.