forked from dasrick/go-teams-notify
-
Notifications
You must be signed in to change notification settings - Fork 16
62 lines (51 loc) · 1.59 KB
/
lint-and-test-only.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2021 Adam Chalkley
#
# https://github.com/atc0005/go-teams-notify
#
# Licensed under the MIT License. See LICENSE file in the project root for
# full license information.
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: ghcr.io/atc0005/go-ci:go-ci-lint-only
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Remove repo-provided golangci-lint config file
run: |
# Remove the copy of the config file bundled with the repo/code so
# that the configuration provided by the atc0005/go-ci project is
# used instead
rm -vf .golangci.yml
- name: Run golangci-lint using container-provided config file settings
run: |
golangci-lint --version
golangci-lint run
- name: Run all tests
run: go test -mod=vendor -v ./...
go_mod_changes:
name: Look for uncommitted Go module changes
runs-on: ubuntu-latest
timeout-minutes: 10
container:
image: ghcr.io/atc0005/go-ci:go-ci-lint-only
steps:
- name: Check out code
uses: actions/checkout@v3
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code go.mod
- name: go mod vendor
run: |
go mod vendor
git diff --exit-code vendor/