-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 2.1 KB
/
Copy pathci.yml
File metadata and controls
65 lines (53 loc) · 2.1 KB
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
63
64
65
# agentbox CI. Runs `make check`, which lints and tests whatever languages are
# present; targets self-skip when their sources are absent, so this stays green
# on a sparse tree and activates per language as code lands. This workflow also
# serves as the fork confirmation gate from the roadmap; fork-specific wiring is
# added with that sub-project.
name: ci
on:
push:
pull_request:
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Go toolchain + linter only when there is a module to build.
- name: Set up Go
if: ${{ hashFiles('go.mod') != '' }}
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install golangci-lint
if: ${{ hashFiles('go.mod') != '' }}
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh \
| sh -s -- -b "$(go env GOPATH)/bin" v2.12.2
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
# shellcheck is preinstalled on ubuntu-latest; add shfmt for the bash target.
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- name: Install ansible-lint
run: pipx install ansible-lint
- name: Set up Packer
uses: hashicorp/setup-packer@v3
with:
version: "1.11.2"
# tmux backs the devctl bats suite (private test socket, no real server).
- name: Install bats and tmux
run: sudo apt-get update && sudo apt-get install -y bats tmux
# terraform_wrapper: false keeps the real binary on PATH so `terraform
# -chdir=... fmt -check` and `validate` run directly, not through a wrapper.
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Set up TFLint
uses: terraform-linters/setup-tflint@v4
# STRICT=1: a missing tool fails the build instead of skipping, so CI
# cannot go green by silently not linting or testing.
- name: make check
run: make check STRICT=1