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 #52

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/dependabot_hack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
steps:
# Keep these sorted alphabetically by <user>/<repo>, separated by an empty line

- uses: ComplianceAsCode/[email protected].68
- uses: ComplianceAsCode/[email protected].70
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
80 changes: 80 additions & 0 deletions .github/workflows/test-salt-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Run salt formula tests on Windows

on:
workflow_call:
inputs:
salt-os-version:
description: Github Windows runner to run the tests on, see <https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources>
required: true
type: string
salt-state:
description: Salt state to execute
required: true
type: string
salt-pillar-root:
description: Relative paths to the salt pillar to test
default: ''
type: string
salt-installer-url:
description: URL to the salt installer
default: ''
type: string
salt-version:
description: Version of salt to install
default: '3006'
type: string
salt-repo-base-url:
description: Base url to search for the salt version; `salt-version` is appended to this url
default: https://repo.saltproject.io/salt/py3/windows
type: string

defaults:
run:
shell: bash

jobs:
test:
runs-on: ${{ inputs.salt-os-version}}
env:
LC_ALL: en_US.utf8
SALT_REPO_URL: https://repo.saltproject.io/salt/py3/windows/${{ inputs.salt-version }}
steps:
- name: Clone this git repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

# Install salt
- if: inputs.salt-installer-url != ''
run: >
curl -sSL -o "${TEMP}/salt-minion-installer.exe" "${{ inputs.salt-installer-url }}"
- if: inputs.salt-installer-url == ''
run: |
SALT_INSTALLER="${SALT_REPO_URL}/$(curl -s "${SALT_REPO_URL}/" | grep -Po '(?<=href=")[^"]*Py3-AMD64-Setup\.exe(?=")')"
curl -sSL -o "${TEMP}/salt-minion-installer.exe" "$SALT_INSTALLER"
- run: >
Start-Process -FilePath "${env:temp}\salt-minion-installer.exe"
-ArgumentList @("/S", "/install-dir=c:\salt")
-NoNewWindow -PassThru -Wait
shell: pwsh
- run: C:\\salt\\salt-call.exe --versions-report

# Sync custom salt modules, if any
- run: >
C:\\salt\\salt-call.exe --local --retcode-passthrough
--log-file-level debug
--file-root="${{ github.workspace }}" --pillar-root=${{ inputs.salt-pillar-root }}
saltutil.sync_all

# Run tests
- run: >
C:\\salt\\salt-call.exe --local --retcode-passthrough --log-level debug
--log-file-level debug
--file-root="${{ github.workspace }}" --pillar-root=${{ inputs.salt-pillar-root }}
state.show_sls
"${{ inputs.salt-state }}"
- run: >
C:\\salt\\salt-call.exe --local --retcode-passthrough
--log-file-level debug
--file-root="${{ github.workspace }}" --pillar-root=${{ inputs.salt-pillar-root }}
state.sls
"${{ inputs.salt-state }}"
mock=True
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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: ./.github/workflows/test-salt-windows.yml
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 }}
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
Loading