Skip to content

Commit 7bbf50e

Browse files
authored
Merge pull request #33 from cisagov/lineage/skeleton
Lineage pull request for: skeleton
2 parents ad96d7c + 29b1f56 commit 7bbf50e

12 files changed

Lines changed: 158 additions & 111 deletions

.ansible-lint

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# See https://ansible-lint.readthedocs.io/en/latest/configuring.html
3+
# for a list of the configuration elements that can exist in this
4+
# file.
5+
enable_list:
6+
# Useful checks that one must opt-into. See here for more details:
7+
# https://ansible-lint.readthedocs.io/en/latest/rules.html
8+
- fcqn-builtins
9+
- no-log-password
10+
- no-same-owner
11+
exclude_paths:
12+
# This exclusion is implicit, unless exclude_paths is defined
13+
- .cache
14+
# Seems wise to ignore this too
15+
- .github
16+
kinds:
17+
# This will force our systemd specific molecule configurations to be treated
18+
# as plain yaml files by ansible-lint. This mirrors the default kind
19+
# configuration in ansible-lint for molecule configurations:
20+
# yaml: "**/molecule/*/{base,molecule}.{yaml,yml}"
21+
- yaml: "**/molecule/*/molecule-{no,with}-systemd.yml"
22+
use_default_rules: true

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
---
22

3+
# Any ignore directives should be uncommented in downstream projects to disable
4+
# Dependabot updates for the given dependency. Downstream projects will get
5+
# these updates when the pull request(s) in the appropriate skeleton are merged
6+
# and Lineage processes these changes.
7+
38
version: 2
49
updates:
510
- package-ecosystem: "github-actions"
611
directory: "/"
712
schedule:
813
interval: "weekly"
14+
ignore:
15+
- dependency-name: actions/cache
16+
- dependency-name: actions/checkout
17+
- dependency-name: actions/setup-python
918

1019
- package-ecosystem: "pip"
1120
directory: "/"
1221
schedule:
1322
interval: "weekly"
23+
24+
- package-ecosystem: "terraform"
25+
directory: "/"
26+
schedule:
27+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,34 @@ jobs:
1717
lint:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: cisagov/setup-env-github-action@develop
21-
- uses: actions/checkout@v2
20+
- id: setup-env
21+
uses: cisagov/setup-env-github-action@develop
22+
- uses: actions/checkout@v3
2223
- id: setup-python
23-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v3
2425
with:
25-
python-version: 3.9
26-
# GO_VERSION and GOCACHE are used by the cache task, so the Go
27-
# installation must happen before that.
26+
python-version: "3.10"
27+
# We need the Go version and Go cache location for the actions/cache step,
28+
# so the Go installation must happen before that.
2829
- uses: actions/setup-go@v2
2930
with:
30-
go-version: '1.16'
31+
go-version: "1.16"
3132
- name: Store installed Go version
33+
id: go-version
3234
run: |
33-
echo "GO_VERSION="\
34-
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
35-
>> $GITHUB_ENV
35+
echo "::set-output name=version::"\
36+
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
3637
- name: Lookup Go cache directory
3738
id: go-cache
3839
run: |
3940
echo "::set-output name=dir::$(go env GOCACHE)"
40-
- uses: actions/cache@v2
41+
- uses: actions/cache@v3
4142
env:
4243
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
4344
py${{ steps.setup-python.outputs.python-version }}-\
44-
go${{ env.GO_VERSION }}-\
45-
packer${{ env.PACKER_VERSION }}-\
46-
tf${{ env.TERRAFORM_VERSION }}-"
45+
go${{ steps.go-version.outputs.version }}-\
46+
packer${{ steps.setup-env.outputs.packer-version }}-\
47+
tf${{ steps.setup-env.outputs.terraform-version }}-"
4748
with:
4849
# Note that the .terraform directory IS NOT included in the
4950
# cache because if we were caching, then we would need to use
@@ -69,6 +70,8 @@ jobs:
6970
- name: Setup curl cache
7071
run: mkdir -p ${{ env.CURL_CACHE_DIR }}
7172
- name: Install Packer
73+
env:
74+
PACKER_VERSION: ${{ steps.setup-env.outputs.packer-version }}
7275
run: |
7376
PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
7477
curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
@@ -81,20 +84,17 @@ jobs:
8184
sudo ln -s /opt/packer/packer /usr/local/bin/packer
8285
- uses: hashicorp/setup-terraform@v1
8386
with:
84-
terraform_version: ${{ env.TERRAFORM_VERSION }}
87+
terraform_version: ${{ steps.setup-env.outputs.terraform-version }}
8588
- name: Install shfmt
86-
run: go install mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}
89+
env:
90+
PACKAGE_URL: mvdan.cc/sh/v3/cmd/shfmt
91+
PACKAGE_VERSION: ${{ steps.setup-env.outputs.shfmt-version }}
92+
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
8793
- name: Install Terraform-docs
88-
run: |
89-
go install \
90-
github.com/terraform-docs/terraform-docs@${TERRAFORM_DOCS_VERSION}
91-
- name: Find and initialize Terraform directories
92-
run: |
93-
for path in $(find . -not \( -type d -name ".terraform" -prune \) \
94-
-type f -iname "*.tf" -exec dirname "{}" \; | sort -u); do \
95-
echo "Initializing '$path'..."; \
96-
terraform init -input=false -backend=false "$path"; \
97-
done
94+
env:
95+
PACKAGE_URL: github.com/terraform-docs/terraform-docs
96+
PACKAGE_VERSION: ${{ steps.setup-env.outputs.terraform-docs-version }}
97+
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
9898
- name: Install dependencies
9999
run: |
100100
python -m pip install --upgrade pip
@@ -109,19 +109,21 @@ jobs:
109109
test:
110110
runs-on: ubuntu-latest
111111
strategy:
112+
fail-fast: false
112113
matrix:
113114
python-version:
114-
- 3.6
115-
- 3.7
116-
- 3.8
117-
- 3.9
115+
- "3.6"
116+
- "3.7"
117+
- "3.8"
118+
- "3.9"
119+
- "3.10"
118120
steps:
119-
- uses: actions/checkout@v2
121+
- uses: actions/checkout@v3
120122
- id: setup-python
121-
uses: actions/setup-python@v2
123+
uses: actions/setup-python@v3
122124
with:
123125
python-version: ${{ matrix.python-version }}
124-
- uses: actions/cache@v2
126+
- uses: actions/cache@v3
125127
env:
126128
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
127129
py${{ steps.setup-python.outputs.python-version }}-"
@@ -159,12 +161,12 @@ jobs:
159161
runs-on: ubuntu-latest
160162
needs: test
161163
steps:
162-
- uses: actions/checkout@v2
164+
- uses: actions/checkout@v3
163165
- id: setup-python
164-
uses: actions/setup-python@v2
166+
uses: actions/setup-python@v3
165167
with:
166-
python-version: 3.9
167-
- uses: actions/cache@v2
168+
python-version: "3.10"
169+
- uses: actions/cache@v3
168170
env:
169171
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
170172
py${{ steps.setup-python.outputs.python-version }}-"
@@ -194,19 +196,21 @@ jobs:
194196
runs-on: ubuntu-latest
195197
needs: [lint, test]
196198
strategy:
199+
fail-fast: false
197200
matrix:
198201
python-version:
199-
- 3.6
200-
- 3.7
201-
- 3.8
202-
- 3.9
202+
- "3.6"
203+
- "3.7"
204+
- "3.8"
205+
- "3.9"
206+
- "3.10"
203207
steps:
204-
- uses: actions/checkout@v2
208+
- uses: actions/checkout@v3
205209
- id: setup-python
206-
uses: actions/setup-python@v2
210+
uses: actions/setup-python@v3
207211
with:
208212
python-version: ${{ matrix.python-version }}
209-
- uses: actions/cache@v2
213+
- uses: actions/cache@v3
210214
env:
211215
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
212216
py${{ steps.setup-python.outputs.python-version }}-"
@@ -220,12 +224,12 @@ jobs:
220224
${{ hashFiles('setup.py') }}"
221225
restore-keys: |
222226
${{ env.BASE_CACHE_KEY }}
223-
- name: Install dependencies
227+
- name: Install build dependencies
224228
run: |
225-
python -m pip install --upgrade pip wheel
226-
pip install --upgrade --requirement requirements.txt
229+
python -m pip install --upgrade pip setuptools wheel
230+
python -m pip install --upgrade build
227231
- name: Build artifacts
228-
run: python3 setup.py sdist bdist_wheel
232+
run: python -m build
229233
- name: Upload artifacts
230234
uses: actions/upload-artifact@v2
231235
with:

.github/workflows/codeql-analysis.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,59 +10,58 @@ on:
1010
push:
1111
# Dependabot triggered push events have read-only access, but uploading code
1212
# scanning requires write access.
13-
branches-ignore: [dependabot/**]
13+
branches-ignore:
14+
- dependabot/**
1415
pull_request:
1516
# The branches below must be a subset of the branches above
16-
branches: [develop]
17+
branches:
18+
- develop
1719
schedule:
1820
- cron: '0 14 * * 6'
1921

2022
jobs:
2123
analyze:
2224
name: Analyze
2325
runs-on: ubuntu-latest
24-
26+
permissions:
27+
# required for all workflows
28+
security-events: write
2529
strategy:
2630
fail-fast: false
2731
matrix:
2832
# Override automatic language detection by changing the below list
29-
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript',
30-
# 'python']
31-
language: ['python']
33+
# Supported options are go, javascript, csharp, python, cpp, and java
34+
language:
35+
- python
3236
# Learn more...
3337
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
3438

3539
steps:
3640
- name: Checkout repository
37-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
3842

3943
# Initializes the CodeQL tools for scanning.
4044
- name: Initialize CodeQL
41-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v2
4246
with:
4347
languages: ${{ matrix.language }}
44-
# If you wish to specify custom queries, you can do so here or in a
45-
# config file. By default, queries listed here will override any
46-
# specified in a config file. Prefix the list here with "+" to use
47-
# these queries and those in the config file. queries:
48-
# ./path/to/local/query, your-org/your-repo/queries@main
4948

50-
# Autobuild attempts to build any compiled languages (C/C++, C#, or
49+
# Autobuild attempts to build any compiled languages (C/C++, C#, or
5150
# Java). If this step fails, then you should remove it and run the build
52-
# manually (see below)
51+
# manually (see below).
5352
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v1
53+
uses: github/codeql-action/autobuild@v2
5554

5655
# ℹ️ Command-line programs to run using the OS shell.
5756
# 📚 https://git.io/JvXDl
5857

5958
# ✏️ If the Autobuild fails above, remove it and uncomment the following
60-
# three lines and modify them (or add more) to build your code if your
61-
# project uses a compiled language
59+
# three lines and modify them (or add more) to build your code if your
60+
# project uses a compiled language
6261

6362
# - run: |
64-
# make bootstrap
65-
# make release
63+
# make bootstrap
64+
# make release
6665

6766
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v1
67+
uses: github/codeql-action/analyze@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ __pycache__
99
.pytest_cache
1010
.python-version
1111
*.egg-info
12+
dist

.mdl_config.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,17 @@ MD035:
4444
# Enforce dashes for horizontal rules
4545
style: "---"
4646

47-
# MD046/code-block-style Code block style
47+
# MD046/code-block-style - Code block style
4848
MD046:
4949
# Enforce the fenced style for code blocks
5050
style: "fenced"
51+
52+
# MD049/emphasis-style - Emphasis style should be consistent
53+
MD049:
54+
# Enforce asterisks as the style to use for emphasis
55+
style: "asterisk"
56+
57+
# MD050/strong-style - Strong style should be consistent
58+
MD050:
59+
# Enforce asterisks as the style to use for strong
60+
style: "asterisk"

0 commit comments

Comments
 (0)