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

gha config files #55

Closed
wants to merge 16 commits into from
30 changes: 26 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
# see http://editorconfig.org
root = true

[*]
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
charset = utf-8
tab_width = 4

[*.md]
[*.md]
trim_trailing_whitespace = false

[*.py]
[*.py]
indent_size = 4

[Makefile]
[*.xml]
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset

[go.mod]
indent_style = tab
indent_size = 1

[*.go]
indent_style = tab
indent_size = 1

[Makefile]
indent_style = tab
indent_size = 1

[Makefile.*]
indent_style = tab
indent_size = 1

[LICENSE]
indent_size = none
trim_trailing_whitespace = unset
26 changes: 18 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
- package-ecosystem: docker
directory: "/scripts"
schedule:
interval: monthly
# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
github-actions:
patterns:
- "*"
# Maintain dependencies for dockerfiles
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
groups:
docker:
patterns:
- "*"
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Run lint and static analyis checks
on:
pull_request:

concurrency:
group: lint-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
uses: plus3it/actions-workflows/.github/workflows/lint.yml@93a9326e07945e5441d0fadef735563290edd729
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# run already
name: Run salt tests
on:
pull_request:

concurrency:
group: test-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: plus3it/actions-workflows/.github/workflows/test-salt-linux.yml@93a9326e07945e5441d0fadef735563290edd729
strategy:
matrix:
os_version:
- 7
- 8
salt_state:
- scap.scan
salt_pillar_root:
- ./tests/pillar/test-oscap
- ./tests/pillar/test-scc
with:
salt-os-version: ${{ matrix.os_version }}
salt-state: ${{ matrix.salt_state }}
salt-pillar-root: ${{ matrix.salt_pillar_root }}

windows:
uses: plus3it/actions-workflows/.github/workflows/test-salt-windows.yml@c9c3d1193bd64bc2a9def11605608a98a3164d96
strategy:
matrix:
os_version:
- windows-2019
- windows-2022
salt_state:
- scap.scan
salt_pillar_root:
- ./tests/pillar/test-scc
with:
salt-os-version: ${{ matrix.os_version }}
salt-state: ${{ matrix.salt_state }}
salt-pillar-root: ${{ matrix.salt_pillar_root }}
salt-installer-url: https://repo.saltproject.io/windows/Salt-Minion-3004.2-1-Py3-AMD64-Setup.exe
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ $RECYCLE.BIN/
*.msm
*.msp

# tardigrade-ci
.tardigrade-ci
tardigrade-ci/

# =========================
# Operating System Files
# =========================
Expand Down
15 changes: 15 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pull_request_rules:
- name: approve dependabot pull requests
conditions:
- author=dependabot[bot]
actions:
review:
type: APPROVE

- name: merge dependabot pull requests
conditions:
- author=dependabot[bot]
- "#approved-reviews-by>=1"
actions:
merge:
method: merge
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM plus3it/tardigrade-ci:0.24.11
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include $(shell test -f .tardigrade-ci || curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci)

MAKEFLAGS += --no-print-directory
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
Expand Down
10 changes: 5 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ environment:
global:
SALT_FILEROOT: '%APPVEYOR_BUILD_FOLDER%'
SALT_STATE: scap.scan
SALT_URL: https://repo.saltproject.io/windows/Salt-Minion-3004.2-1-Py3-AMD64-Setup.exe
SALT_URL: https://repo.saltproject.io/salt/py3/windows/minor/3006.4/Salt-Minion-3006.4-Py3-AMD64-Setup.exe
matrix:
- SALT_PILLARROOT: '%APPVEYOR_BUILD_FOLDER%\tests\pillar\test-scc'

Expand All @@ -22,18 +22,18 @@ install:
$null = `
Start-Process -FilePath "${env:temp}\salt-minion.exe" `
-ArgumentList @("/S", "/install-dir=c:\salt") -NoNewWindow -PassThru -Wait
- ps: C:\salt\salt-call.bat --versions-report
- ps: C:\salt\salt-call.exe --versions-report

test_script:
- ps: |
C:\salt\salt-call.bat --local --retcode-passthrough `
C:\salt\salt-call.exe --local --retcode-passthrough `
--log-file-level debug `
--file-root="${env:SALT_FILEROOT}" `
--pillar-root="${env:SALT_PILLARROOT}" `
state.show_sls `
"${env:SALT_STATE}"
- ps: |
C:\salt\salt-call.bat --local --retcode-passthrough `
C:\salt\salt-call.exe --local --retcode-passthrough `
--log-file-level debug `
--file-root="${env:SALT_FILEROOT}" `
--pillar-root="${env:SALT_PILLARROOT}" `
Expand All @@ -42,7 +42,7 @@ test_script:
mock=True

on_failure:
- ps: C:\salt\salt-call.bat --local grains.items
- ps: C:\salt\salt-call.exe --local grains.items
- ps: dir "env:"
- ps: get-content C:\salt\var\log\salt\*

Expand Down
1 change: 1 addition & 0 deletions scripts/build_in_docker.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
set -eu -o pipefail

SCRIPT_DIR="${BASH_SOURCE[0]}"
Expand Down
10 changes: 5 additions & 5 deletions scripts/build_ssg_content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ exec > >(tee "${DIST_DIR}/build-content.log") 2>&1

# Clone the repo and checkout the latest tag
git clone "$REPO" "$BUILD_DIR" && pushd "$BUILD_DIR"
TAG="${SSG_VER:-$(git describe --tags $(git rev-list --tags --max-count=1))}"
TAG="${SSG_VER:-$(git describe --tags "$(git rev-list --tags --max-count=1)")}"
echo
echo "Tag to build: ${TAG}"
echo
git checkout "$TAG"
echo

# Update standard_profiles
echo "Ensuring ssg content includes required profiles: ${PROFILES[@]}"
echo "Ensuring ssg content includes required profiles: ${PROFILES[*]}"
ssg_constants="${BUILD_DIR}/ssg/constants.py"
for profile in "${PROFILES[@]}"
do
if grep -e 'standard_profiles' "$ssg_constants" | grep -e \'$profile\'; then
if grep -e 'standard_profiles' "$ssg_constants" | grep -e \'"$profile"\'; then
echo "-- Profile $profile already exists. Will not be added."
else
echo "-- Profile $profile was not found. $profile will be added to standard_profiles."
sed -i '/standard_profiles = \[/ s/]/,\ '\'$profile\''&/' "$ssg_constants"
sed -i '/standard_profiles = \[/ s/]/,\ '\'"$profile"\''&/' "$ssg_constants"
fi
done
echo "Done adding profiles..."
Expand All @@ -57,7 +57,7 @@ cmake -G Ninja -DSSG_TARGET_OVAL_MINOR_VERSION:STRING=11 ../
ninja -j 4 "${MAKE_TARGETS_RHEL[@]}"
ninja -j 4 "${MAKE_TARGETS_OTHERS[@]}"

cp *-ds.xml *-xccdf.xml *-oval.xml *-cpe-dictionary.xml *-ocil.xml "$DIST_DIR"
cp ./*-ds.xml ./*-xccdf.xml ./*-oval.xml ./*-cpe-dictionary.xml ./*-ocil.xml "$DIST_DIR"

echo
echo 'Done building content!'
Expand Down
Empty file added tests/requirements-el7.txt
Empty file.
Empty file added tests/requirements-el8.txt
Empty file.
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
salt-minion
Loading