Re-work the CI pipeline

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-08-11 14:40:07 +01:00 committed by Pedro Algarvio
parent 7ae790f5e4
commit 494fe6f933
23 changed files with 1341 additions and 4357 deletions

566
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,566 @@
name: CI
on:
- push
- pull_request
concurrency:
# If changes are pushed to a PR, stop all running workflows before starting new ones
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-bootstrap' && github.run_id || github.ref_name) }}
cancel-in-progress: true
jobs:
collect-changed-files:
name: Collect changed files
runs-on: ubuntu-latest
outputs:
run-tests: ${{ steps.set-output.outputs.run-tests }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@v25
with:
separator: ","
files: |
bootstrap-salt.*
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
- name: Set Job Output
id: set-output
run: |
echo "::set-output name=run-tests::${{ steps.changed-files.outputs.any_modified }}"
generate-actions-workflow:
name: Generate The Actions Workflow
runs-on: ubuntu-latest
needs: collect-changed-files
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Pre-Commit
run: |
python3 -m pip install -U pip
python3 -m pip install pre-commit
pre-commit install --install-hooks
- name: Generate Workflow Actions
run: |
pre-commit run -av generate-actions-workflow
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
lint:
name: Lint
runs-on: ubuntu-latest
needs: collect-changed-files
container: koalaman/shellcheck-alpine:v0.6.0
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
almalinux-8:
name: AlmaLinux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: almalinux-8
display-name: AlmaLinux 8
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
amazon-2:
name: Amazon 2
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: amazon-2
display-name: Amazon 2
timeout: 20
instances: '["stable-3003", "stable-3004", "git-master", "latest"]'
arch:
name: Arch
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: arch
display-name: Arch
timeout: 20
instances: '["git-master", "latest"]'
centos-7:
name: CentOS 7
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: centos-7
display-name: CentOS 7
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
centos-stream8:
name: CentOS Stream 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: centos-stream8
display-name: CentOS Stream 8
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
debian-10:
name: Debian 10
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: debian-10
display-name: Debian 10
timeout: 20
instances: '["stable-3003", "stable-3004", "git-master", "latest"]'
debian-11:
name: Debian 11
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: debian-11
display-name: Debian 11
timeout: 20
instances: '["stable-3004", "git-master", "latest"]'
debian-9:
name: Debian 9
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: debian-9
display-name: Debian 9
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
fedora-35:
name: Fedora 35
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: fedora-35
display-name: Fedora 35
timeout: 20
instances: '["git-master", "latest"]'
fedora-36:
name: Fedora 36
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: fedora-36
display-name: Fedora 36
timeout: 20
instances: '["git-master", "latest"]'
gentoo:
name: Gentoo
if: github.event_name == 'push'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: gentoo
display-name: Gentoo
timeout: 90
instances: '["git-master", "latest"]'
gentoo-systemd:
name: Gentoo (systemd)
if: github.event_name == 'push'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: gentoo-systemd
display-name: Gentoo (systemd)
timeout: 90
instances: '["git-master", "latest"]'
opensuse-15:
name: Opensuse 15
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: opensuse-15
display-name: Opensuse 15
timeout: 20
instances: '["git-master", "latest"]'
opensuse-tumbleweed:
name: Opensuse Tumbleweed
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: opensuse-tumbleweed
display-name: Opensuse Tumbleweed
timeout: 20
instances: '["git-master", "latest"]'
oraclelinux-7:
name: Oracle Linux 7
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: oraclelinux-7
display-name: Oracle Linux 7
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
oraclelinux-8:
name: Oracle Linux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: oraclelinux-8
display-name: Oracle Linux 8
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
rockylinux-8:
name: Rocky Linux 8
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: rockylinux-8
display-name: Rocky Linux 8
timeout: 20
instances: '["stable-3004", "git-3004", "git-master", "latest"]'
ubuntu-1804:
name: Ubuntu 18.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-1804
display-name: Ubuntu 18.04
timeout: 20
instances: '["stable-3003", "git-3003", "stable-3004", "git-3004", "git-master", "latest"]'
ubuntu-2004:
name: Ubuntu 20.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-2004
display-name: Ubuntu 20.04
timeout: 20
instances: '["stable-3003", "stable-3004", "git-master", "latest"]'
ubuntu-2204:
name: Ubuntu 22.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-2204
display-name: Ubuntu 22.04
timeout: 20
instances: '["stable-3004", "git-master", "latest"]'
windows-2019:
name: Windows 2019
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-windows.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: windows-2019
display-name: Windows 2019
timeout: 20
runs-on: windows-2019
instances: '["stable-3003", "stable-3004", "latest"]'
windows-2022:
name: Windows 2022
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-windows.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: windows-2022
display-name: Windows 2022
timeout: 20
runs-on: windows-2022
instances: '["stable-3003", "stable-3004", "latest"]'
macos-1015:
name: macOS 10.15
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-macos.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: macos-1015
display-name: macOS 10.15
timeout: 20
runs-on: macos-10.15
instances: '["stable-3003", "stable-3004", "latest"]'
macos-11:
name: macOS 11
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-macos.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: macos-11
display-name: macOS 11
timeout: 20
runs-on: macos-11
instances: '["stable-3003", "stable-3004", "latest"]'
macos-12:
name: macOS 12
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-macos.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: macos-12
display-name: macOS 12
timeout: 20
runs-on: macos-12
instances: '["stable-3003", "stable-3004", "latest"]'
freebsd-131:
name: FreeBSD 13.1
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: freebsd-131
display-name: FreeBSD 13.1
timeout: 20
runs-on: macos-10.15
instances: '["git-master", "latest"]'
freebsd-123:
name: FreeBSD 12.3
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: freebsd-123
display-name: FreeBSD 12.3
timeout: 20
runs-on: macos-10.15
instances: '["git-master", "latest"]'
openbsd-6:
name: OpenBSD 6
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-bsd.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: openbsd-6
display-name: OpenBSD 6
timeout: 20
runs-on: macos-10.15
instances: '["latest"]'
set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
# on a pull request instead of requiring all
name: Set the ${{ github.workflow }} Pipeline Exit Status
runs-on: ubuntu-latest
needs:
- lint
- generate-actions-workflow
- almalinux-8
- amazon-2
- arch
- centos-7
- centos-stream8
- debian-10
- debian-11
- debian-9
- fedora-35
- fedora-36
- gentoo
- gentoo-systemd
- opensuse-15
- opensuse-tumbleweed
- oraclelinux-7
- oraclelinux-8
- rockylinux-8
- ubuntu-1804
- ubuntu-2004
- ubuntu-2204
- windows-2019
- windows-2022
- macos-1015
- macos-11
- macos-12
- freebsd-131
- freebsd-123
- openbsd-6
if: always()
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v3
with:
name: exitstatus
path: exitstatus
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v1
with:
name: exitstatus
failOnError: false
- name: Set Pipeline Exit Status
run: |
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Done
if: always()
run:
echo "All worflows finished"

View file

@ -1,129 +0,0 @@
# yamllint disable rule:line-length
---
name: 'Kitchen (macOS)'
'on': ['push', 'pull_request']
env:
KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'
jobs:
generate-actions-workflow:
name: 'Generate The Actions Workflow'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v1'
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: 3.7
- name: 'Install Pre-Commit'
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: 'Generate Workflow Actions'
run: |
pre-commit run -av generate-actions-workflow
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
needs: 'generate-actions-workflow'
container: 'koalaman/shellcheck-alpine:v0.6.0'
steps:
- uses: 'actions/checkout@v1'
- name: 'ShellCheck'
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
test-12:
runs-on: 'macos-12'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- latest-macos-12
- py3-stable-3004-macos-12
- py3-stable-3003-macos-12
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Install Python Dependencies'
run: |
pip3 install -U pip
pip3 install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'
test-11:
runs-on: 'macos-11'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- latest-macos-11
- py3-stable-3004-macos-11
- py3-stable-3003-macos-11
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Install Python Dependencies'
run: |
pip3 install -U pip
pip3 install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'
test-1015:
runs-on: 'macos-10.15'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- latest-macos-1015
- py3-stable-3004-macos-1015
- py3-stable-3003-macos-1015
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Install Python Dependencies'
run: |
pip3 install -U pip
pip3 install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'

View file

@ -1,73 +0,0 @@
---
name: 'Kitchen Vagrant (FreeBSD & OpenBSD)'
'on': ['push', 'pull_request']
env:
KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml'
jobs:
generate-actions-workflow:
name: 'Generate The Actions Workflow'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v1'
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: 3.7
- name: 'Install Pre-Commit'
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: 'Generate Workflow Actions'
run: |
pre-commit run -av generate-actions-workflow
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
needs: 'generate-actions-workflow'
container: 'koalaman/shellcheck-alpine:v0.6.0'
steps:
- uses: 'actions/checkout@v1'
- name: 'ShellCheck'
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
test:
runs-on: 'macos-10.15'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-git-master-freebsd-131
- py3-git-master-freebsd-123
# - py3-git-master-openbsd-6
- latest-freebsd-131
- latest-freebsd-123
- latest-openbsd-6
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'

View file

@ -1,147 +0,0 @@
# yamllint disable rule:line-length
---
name: 'Kitchen (Windows)'
'on': ['push', 'pull_request']
env:
machine_user: kitchen
machine_pass: Password1
machine_port: 5985
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
jobs:
generate-actions-workflow:
name: 'Generate The Actions Workflow'
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v1'
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: 3.7
- name: 'Install Pre-Commit'
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: 'Generate Workflow Actions'
run: |
pre-commit run -av generate-actions-workflow
lint:
name: 'Lint'
runs-on: 'ubuntu-latest'
needs: 'generate-actions-workflow'
container: 'koalaman/shellcheck-alpine:v0.6.0'
steps:
- uses: 'actions/checkout@v1'
- name: 'ShellCheck'
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
test-2022:
runs-on: 'windows-2022'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-stable-3003-windows-2022
- py3-stable-3004-windows-2022
- latest-windows-2022
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Install Chef'
uses: 'actionshub/chef-install@1.1.0'
with:
project: 'chef'
version: '16.10.8'
- name: 'Add Chef bindir to PATH'
uses: 'myci-actions/export-env-var-powershell@1'
with:
name: 'PATH'
value: "C:\\opscode\\chef\\bin;\
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Set up test user'
run: |
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
New-LocalUser $env:machine_user -Password $password
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
- name: 'Set up WinRM'
run: |
Set-WSManQuickConfig -Force
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'
test-2019:
runs-on: 'windows-2019'
timeout-minutes: 20
needs: 'lint'
strategy:
fail-fast: false
matrix:
instance:
- py3-stable-3003-windows-2019
- py3-stable-3004-windows-2019
- latest-windows-2019
steps:
- name: 'Check out code'
uses: 'actions/checkout@v2'
- name: 'Install Chef'
uses: 'actionshub/chef-install@1.1.0'
with:
project: 'chef'
version: '16.10.8'
- name: 'Add Chef bindir to PATH'
uses: 'myci-actions/export-env-var-powershell@1'
with:
name: 'PATH'
value: "C:\\opscode\\chef\\bin;\
C:\\opscode\\chef\\embedded\\bin;$env:PATH"
- name: 'Set up Bundler cache'
uses: 'actions/cache@v1'
with:
path: 'vendor/bundle'
key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}"
restore-keys: "${{ runner.os }}-gems-"
- name: 'Set up test user'
run: |
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
New-LocalUser $env:machine_user -Password $password
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
- name: 'Set up WinRM'
run: |
Set-WSManQuickConfig -Force
- name: 'Run Bundler'
run: |
ruby --version
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: 'Set up Python 3.7'
uses: 'actions/setup-python@v1'
with:
python-version: '3.7'
- name: 'Install Python Dependencies'
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: 'Run Test Kitchen'
run: 'bundle exec kitchen test ${{ matrix.instance }}'

View file

@ -1,195 +0,0 @@
# DO NOT EDIT THIS FILE DIRECTLY!
#
# This file was generated by .github/workflows/templates/generate.py
#
# yamllint disable rule:line-length rule:empty-lines
---
name: Branch Testing
'on': [push]
jobs:
py3-git-master-gentoo:
name: Gentoo Master Py3 Git
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create py3-git-master-gentoo || bundle exec kitchen create py3-git-master-gentoo
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify py3-git-master-gentoo
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy py3-git-master-gentoo
latest-gentoo:
name: Gentoo Latest packaged release
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create latest-gentoo || bundle exec kitchen create latest-gentoo
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify latest-gentoo
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy latest-gentoo
py3-git-master-gentoo-systemd:
name: Gentoo (systemd) Master Py3 Git
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create py3-git-master-gentoo-systemd || bundle exec kitchen create py3-git-master-gentoo-systemd
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify py3-git-master-gentoo-systemd
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy py3-git-master-gentoo-systemd
latest-gentoo-systemd:
name: Gentoo (systemd) Latest packaged release
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create latest-gentoo-systemd || bundle exec kitchen create latest-gentoo-systemd
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify latest-gentoo-systemd
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy latest-gentoo-systemd

File diff suppressed because it is too large Load diff

33
.github/workflows/templates/ci-tail.yml vendored Normal file
View file

@ -0,0 +1,33 @@
set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
# on a pull request instead of requiring all
name: Set the ${{{{ github.workflow }}}} Pipeline Exit Status
runs-on: ubuntu-latest
needs:
{needs}
if: always()
steps:
- name: Download Exit Status Files
if: always()
uses: actions/download-artifact@v3
with:
name: exitstatus
path: exitstatus
- name: Delete Exit Status Artifacts
if: always()
uses: geekyeggo/delete-artifact@v1
with:
name: exitstatus
failOnError: false
- name: Set Pipeline Exit Status
run: |
grep -RE 'failure|cancelled' exitstatus/ && exit 1 || exit 0
- name: Done
if: always()
run:
echo "All worflows finished"

100
.github/workflows/templates/ci.yml vendored Normal file
View file

@ -0,0 +1,100 @@
name: CI
on:
- push
- pull_request
concurrency:
# If changes are pushed to a PR, stop all running workflows before starting new ones
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-bootstrap' && github.run_id || github.ref_name) }}
cancel-in-progress: true
jobs:
collect-changed-files:
name: Collect changed files
runs-on: ubuntu-latest
outputs:
run-tests: ${{ steps.set-output.outputs.run-tests }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files
uses: tj-actions/changed-files@v25
with:
separator: ","
files: |
bootstrap-salt.*
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
- name: Set Job Output
id: set-output
run: |
echo "::set-output name=run-tests::${{ steps.changed-files.outputs.any_modified }}"
generate-actions-workflow:
name: Generate The Actions Workflow
runs-on: ubuntu-latest
needs: collect-changed-files
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Pre-Commit
run: |
python3 -m pip install -U pip
python3 -m pip install pre-commit
pre-commit install --install-hooks
- name: Generate Workflow Actions
run: |
pre-commit run -av generate-actions-workflow
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus
lint:
name: Lint
runs-on: ubuntu-latest
needs: collect-changed-files
container: koalaman/shellcheck-alpine:v0.6.0
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
steps:
- uses: actions/checkout@v3
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import json
import pathlib
import datetime import datetime
os.chdir(os.path.abspath(os.path.dirname(__file__))) os.chdir(os.path.abspath(os.path.dirname(__file__)))
@ -27,7 +29,21 @@ LINUX_DISTROS = [
"ubuntu-2004", "ubuntu-2004",
"ubuntu-2204", "ubuntu-2204",
] ]
OSX = WINDOWS = [] WINDOWS = [
"windows-2019",
"windows-2022",
]
OSX = [
"macos-1015",
"macos-11",
"macos-12",
]
BSD = [
"freebsd-131",
"freebsd-123",
"openbsd-6",
]
STABLE_DISTROS = [ STABLE_DISTROS = [
"almalinux-8", "almalinux-8",
@ -108,21 +124,21 @@ BLACKLIST_GIT_3004 = [
"ubuntu-2204", "ubuntu-2204",
] ]
SALT_BRANCHES = [ SALT_VERSIONS = [
"3003", "3003",
"3004", "3004",
"master", "master",
"latest", "latest",
] ]
BRANCH_DISPLAY_NAMES = { VERSION_DISPLAY_NAMES = {
"3003": "v3003", "3003": "v3003",
"3004": "v3004", "3004": "v3004",
"master": "Master", "master": "Master",
"latest": "Latest", "latest": "Latest",
} }
STABLE_BRANCH_BLACKLIST = [] STABLE_VERSION_BLACKLIST = []
LATEST_PKG_BLACKLIST = [] LATEST_PKG_BLACKLIST = []
@ -147,6 +163,14 @@ DISTRO_DISPLAY_NAMES = {
"ubuntu-1804": "Ubuntu 18.04", "ubuntu-1804": "Ubuntu 18.04",
"ubuntu-2004": "Ubuntu 20.04", "ubuntu-2004": "Ubuntu 20.04",
"ubuntu-2204": "Ubuntu 22.04", "ubuntu-2204": "Ubuntu 22.04",
"macos-1015": "macOS 10.15",
"macos-11": "macOS 11",
"macos-12": "macOS 12",
"freebsd-131": "FreeBSD 13.1",
"freebsd-123": "FreeBSD 12.3",
"openbsd-6": "OpenBSD 6",
"windows-2019": "Windows 2019",
"windows-2022": "Windows 2022",
} }
TIMEOUT_DEFAULT = 20 TIMEOUT_DEFAULT = 20
@ -154,168 +178,270 @@ TIMEOUT_OVERRIDES = {
"gentoo": 90, "gentoo": 90,
"gentoo-systemd": 90, "gentoo-systemd": 90,
} }
BRANCH_ONLY_OVERRIDES = [ VERSION_ONLY_OVERRIDES = [
"gentoo", "gentoo",
"gentoo-systemd", "gentoo-systemd",
] ]
TEMPLATE = """
{distro}:
name: {display_name}{ifcheck}
uses: {uses}
needs:
- lint
- generate-actions-workflow
with:
distro-slug: {distro}
display-name: {display_name}
timeout: {timeout_minutes}{runs_on}
instances: '{instances}'
"""
def generate_test_jobs(): def generate_test_jobs():
test_jobs = "" test_jobs = ""
branch_only_test_jobs = "" needs = ["lint", "generate-actions-workflow"]
for distro in LINUX_DISTROS + OSX + WINDOWS: for distro in LINUX_DISTROS:
test_jobs += "\n"
runs_on = ""
ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'"
uses = "./.github/workflows/test-linux.yml"
instances = []
timeout_minutes = ( timeout_minutes = (
TIMEOUT_OVERRIDES[distro] TIMEOUT_OVERRIDES[distro]
if distro in TIMEOUT_OVERRIDES if distro in TIMEOUT_OVERRIDES
else TIMEOUT_DEFAULT else TIMEOUT_DEFAULT
) )
needs = " needs: lint" if distro in VERSION_ONLY_OVERRIDES:
if distro in BRANCH_ONLY_OVERRIDES: ifcheck = "\n if: github.event_name == 'push'"
needs = ""
current_test_jobs = ""
for branch in SALT_BRANCHES: for salt_version in SALT_VERSIONS:
if branch == "latest": if salt_version == "latest":
if distro in LATEST_PKG_BLACKLIST: if distro in LATEST_PKG_BLACKLIST:
continue continue
if distro in LINUX_DISTROS:
template = "linux.yml"
elif distro in OSX:
template = "osx.yml"
elif distro in WINDOWS:
template = "windows.yml"
else:
print("Don't know how to handle {}".format(distro))
with open(template) as rfh: instances.append(salt_version)
current_test_jobs += "\n{}\n".format(
rfh.read()
.replace(
"{python_version}-{bootstrap_type}-{branch}-{distro}",
"{branch}-{distro}",
)
.format(
distro=distro,
branch=branch,
display_name="{} Latest packaged release".format(
DISTRO_DISPLAY_NAMES[distro],
),
timeout_minutes=timeout_minutes,
needs=needs,
)
)
continue continue
for python_version in ("py3",): for bootstrap_type in ("stable", "git"):
if bootstrap_type == "stable":
for bootstrap_type in ("stable", "git"): if salt_version == "master":
if bootstrap_type == "stable": # For the master branch there's no stable build
if branch == "master": continue
# For the master branch there's no stable build if distro not in STABLE_DISTROS:
continue
if distro not in STABLE_DISTROS:
continue
if branch in STABLE_BRANCH_BLACKLIST:
continue
if distro.startswith("fedora") and branch != "latest":
# Fedora does not keep old builds around
continue
BLACKLIST = {
"3003": BLACKLIST_3003,
"3004": BLACKLIST_3004,
}
if bootstrap_type == "git":
BLACKLIST = {
"3003": BLACKLIST_GIT_3003,
"3004": BLACKLIST_GIT_3004,
}
# .0 versions are a virtual version for pinning to the first point release of a major release, such as 3003, there is no git version.
if branch.endswith("-0"):
continue
if (
branch in ("3003", "3004")
and distro in BLACKLIST[branch]
):
continue continue
if distro in LINUX_DISTROS: if salt_version in STABLE_VERSION_BLACKLIST:
template = "linux.yml" continue
elif distro in OSX:
template = "osx.yml"
elif distro in WINDOWS:
template = "windows.yml"
else:
print("Don't know how to handle {}".format(distro))
with open(template) as rfh: if distro.startswith("fedora") and salt_version != "latest":
current_test_jobs += "\n{}\n".format( # Fedora does not keep old builds around
rfh.read().format( continue
distro=distro,
branch=branch, BLACKLIST = {
python_version=python_version, "3003": BLACKLIST_3003,
bootstrap_type=bootstrap_type, "3004": BLACKLIST_3004,
display_name="{} {} {} {}".format( }
DISTRO_DISPLAY_NAMES[distro], if bootstrap_type == "git":
BRANCH_DISPLAY_NAMES[branch], BLACKLIST = {
python_version.capitalize(), "3003": BLACKLIST_GIT_3003,
bootstrap_type.capitalize(), "3004": BLACKLIST_GIT_3004,
), }
timeout_minutes=timeout_minutes,
needs=needs, # .0 versions are a virtual version for pinning to the first
) # point release of a major release, such as 3003,
) # there is no git version.
if distro in BRANCH_ONLY_OVERRIDES: if salt_version.endswith("-0"):
branch_only_test_jobs += current_test_jobs continue
if (
salt_version in ("3003", "3004")
and distro in BLACKLIST[salt_version]
):
continue
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
distro=distro,
runs_on=runs_on,
uses=uses,
ifcheck=ifcheck,
instances=json.dumps(instances),
display_name=DISTRO_DISPLAY_NAMES[distro],
timeout_minutes=timeout_minutes,
)
test_jobs += "\n"
for distro in WINDOWS:
test_jobs += "\n"
runs_on = f"\n runs-on: {distro}"
ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'"
uses = "./.github/workflows/test-windows.yml"
instances = []
timeout_minutes = (
TIMEOUT_OVERRIDES[distro]
if distro in TIMEOUT_OVERRIDES
else TIMEOUT_DEFAULT
)
for salt_version in SALT_VERSIONS:
if salt_version == "latest":
instances.append(salt_version)
continue
for bootstrap_type in ("stable",):
if bootstrap_type == "stable":
if salt_version == "master":
# For the master branch there's no stable build
continue
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
distro=distro,
runs_on=runs_on,
uses=uses,
ifcheck=ifcheck,
instances=json.dumps(instances),
display_name=DISTRO_DISPLAY_NAMES[distro],
timeout_minutes=timeout_minutes,
)
test_jobs += "\n"
for distro in OSX:
test_jobs += "\n"
if distro == "macos-1015":
runs_on = "macos-10.15"
else: else:
test_jobs += current_test_jobs runs_on = distro
runs_on = f"\n runs-on: {runs_on}"
ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'"
uses = "./.github/workflows/test-macos.yml"
instances = []
timeout_minutes = (
TIMEOUT_OVERRIDES[distro]
if distro in TIMEOUT_OVERRIDES
else TIMEOUT_DEFAULT
)
with open("lint.yml") as rfh: for salt_version in SALT_VERSIONS:
lint_job = "\n{}\n".format(rfh.read())
with open("pre-commit.yml") as rfh: if salt_version == "latest":
pre_commit_job = "\n{}\n".format(rfh.read())
with open("../main.yml", "w") as wfh: instances.append(salt_version)
with open("main.yml") as rfh: continue
wfh.write(
"{}\n".format( for bootstrap_type in ("stable",):
rfh.read() if bootstrap_type == "stable":
.format( if salt_version == "master":
jobs="{pre_commit}{lint}{test}".format( # For the master branch there's no stable build
lint=lint_job, continue
test=test_jobs,
pre_commit=pre_commit_job, kitchen_target = f"{bootstrap_type}-{salt_version}"
), instances.append(kitchen_target)
on="push, pull_request",
name="Testing", if instances:
) needs.append(distro)
.strip() test_jobs += TEMPLATE.format(
) distro=distro,
runs_on=runs_on,
uses=uses,
ifcheck=ifcheck,
instances=json.dumps(instances),
display_name=DISTRO_DISPLAY_NAMES[distro],
timeout_minutes=timeout_minutes,
) )
with open("../main-branch-only.yml", "w") as wfh: test_jobs += "\n"
with open("main.yml") as rfh: for distro in BSD:
wfh.write( test_jobs += "\n"
"{}\n".format( runs_on = "macos-10.15"
rfh.read() runs_on = f"\n runs-on: {runs_on}"
.format( ifcheck = "\n if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'"
jobs="{test}".format( uses = "./.github/workflows/test-bsd.yml"
test=branch_only_test_jobs, instances = []
), timeout_minutes = (
on="push", TIMEOUT_OVERRIDES[distro]
name="Branch Testing", if distro in TIMEOUT_OVERRIDES
) else TIMEOUT_DEFAULT
.strip() )
) for salt_version in SALT_VERSIONS:
if salt_version == "latest":
if distro in LATEST_PKG_BLACKLIST:
continue
instances.append(salt_version)
continue
if distro == "openbsd-6":
# Only test latest on OpenBSD 6
continue
if salt_version != "master":
# Only test the master branch on BSD's
continue
# BSD's don't have a stable release, only use git
for bootstrap_type in ("git",):
BLACKLIST = {
"3003": BLACKLIST_3003,
"3004": BLACKLIST_3004,
}
if bootstrap_type == "git":
BLACKLIST = {
"3003": BLACKLIST_GIT_3003,
"3004": BLACKLIST_GIT_3004,
}
# .0 versions are a virtual version for pinning to the first
# point release of a major release, such as 3003,
# there is no git version.
if salt_version.endswith("-0"):
continue
if (
salt_version in ("3003", "3004")
and distro in BLACKLIST[salt_version]
):
continue
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
distro=distro,
runs_on=runs_on,
uses=uses,
ifcheck=ifcheck,
instances=json.dumps(instances),
display_name=DISTRO_DISPLAY_NAMES[distro],
timeout_minutes=timeout_minutes,
) )
ci_src_workflow = pathlib.Path("ci.yml").resolve()
ci_tail_src_workflow = pathlib.Path("ci-tail.yml").resolve()
ci_dst_workflow = pathlib.Path("../ci.yml").resolve()
ci_workflow_contents = ci_src_workflow.read_text() + test_jobs + "\n"
ci_workflow_contents += ci_tail_src_workflow.read_text().format(
needs="\n".join([f" - {need}" for need in needs]).lstrip()
)
ci_dst_workflow.write_text(ci_workflow_contents)
if __name__ == "__main__": if __name__ == "__main__":
generate_test_jobs() generate_test_jobs()

View file

@ -1,12 +0,0 @@
lint:
name: Lint
runs-on: ubuntu-latest
needs: generate-actions-workflow
container: koalaman/shellcheck-alpine:v0.6.0
steps:
- uses: actions/checkout@v1
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh

View file

@ -1,44 +0,0 @@
{python_version}-{bootstrap_type}-{branch}-{distro}:
name: {display_name}
runs-on: ubuntu-latest
timeout-minutes: {timeout_minutes}
{needs}
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Install Bundler
run: |
gem install bundler
- name: Setup Bundle
run: |
bundle install --with docker --without opennebula ec2 windows vagrant
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Container
run: |
bundle exec kitchen create {python_version}-{bootstrap_type}-{branch}-{distro} || bundle exec kitchen create {python_version}-{bootstrap_type}-{branch}-{distro}
- name: Test Bootstrap In Test Container
run: |
bundle exec kitchen verify {python_version}-{bootstrap_type}-{branch}-{distro}
- name: Destroy Test Container
if: always()
run: |
bundle exec kitchen destroy {python_version}-{bootstrap_type}-{branch}-{distro}

View file

@ -1,13 +0,0 @@
# DO NOT EDIT THIS FILE DIRECTLY!
#
# This file was generated by .github/workflows/templates/generate.py
#
# yamllint disable rule:line-length rule:empty-lines
---
name: {name}
'on': [{on}]
jobs:
{jobs}

View file

@ -1,20 +0,0 @@
generate-actions-workflow:
name: Generate The Actions Workflow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install Pre-Commit
run: |
pip install -U pip
pip install pre-commit
pre-commit install
- name: Generate Workflow Actions
run: |
pre-commit run -av generate-actions-workflow

88
.github/workflows/test-bsd.yml vendored Normal file
View file

@ -0,0 +1,88 @@
name: Test FreeBSD & OpenBSD
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
runs-on:
type: string
required: true
description: The GitHub MacOS Worker To Run Workflow On
instances:
type: string
required: true
description: The Instances To Test
timeout:
type: number
required: false
default: 20
description: The timeout(in minutes) for the workflow
env:
KITCHEN_LOCAL_YAML: 'kitchen.bsd.yml'
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ${{ inputs.runs-on }}
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
bundler-cache: true
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Instance
run: |
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
- name: Test Bootstrap
run: |
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Destroy Test Instance
if: always()
run: |
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus

80
.github/workflows/test-linux.yml vendored Normal file
View file

@ -0,0 +1,80 @@
name: Test Linux
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
instances:
type: string
required: true
description: The Instances To Test
timeout:
type: number
required: false
default: 20
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
bundler-cache: true
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python Dependencies
run: |
python3 -m pip install -U pip
python3 -m pip install -r tests/requirements.txt
- name: Create Test Instance
run: |
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
- name: Test Bootstrap
run: |
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Destroy Test Instance
if: always()
run: |
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus

88
.github/workflows/test-macos.yml vendored Normal file
View file

@ -0,0 +1,88 @@
name: Test MacOS
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
runs-on:
type: string
required: true
description: The GitHub MacOS Worker To Run Workflow On
instances:
type: string
required: true
description: The Instances To Test
timeout:
type: number
required: false
default: 20
description: The timeout(in minutes) for the workflow
env:
KITCHEN_LOCAL_YAML: 'kitchen.macos.yml'
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ${{ inputs.runs-on }}
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
bundler-cache: true
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Instance
run: |
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
- name: Test Bootstrap
run: |
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Destroy Test Instance
if: always()
run: |
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus

113
.github/workflows/test-windows.yml vendored Normal file
View file

@ -0,0 +1,113 @@
name: Test Windows
on:
workflow_call:
inputs:
distro-slug:
type: string
required: true
description: The Distribution Slug
display-name:
type: string
required: true
description: The Display Name For The Job
runs-on:
type: string
required: true
description: The GitHub Windows Worker To Run Workflow On
instances:
type: string
required: true
description: The Instances To Test
timeout:
type: number
required: false
default: 20
description: The timeout(in minutes) for the workflow
env:
machine_user: kitchen
machine_pass: Password1
machine_port: 5985
KITCHEN_LOCAL_YAML: 'kitchen.windows.yml'
jobs:
Test:
name: ${{ matrix.instance }}
runs-on: ${{ inputs.runs-on }}
timeout-minutes: ${{ inputs.timeout }}
strategy:
fail-fast: false
matrix:
instance: ${{ fromJSON(inputs.instances) }}
steps:
- uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.10
bundler-cache: true
- name: Install Chef
uses: actionshub/chef-install@1.1.0
with:
project: chef
version: 16.10.8
- name: Add Chef bindir to PATH
uses: myci-actions/export-env-var-powershell@1
with:
name: PATH
value: "C:\\opscode\\chef\\bin;C:\\opscode\\chef\\embedded\\bin;$env:PATH"
- name: Setup test user
run: |
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
New-LocalUser $env:machine_user -Password $password
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
- name: Set up WinRM
run: |
Set-WSManQuickConfig -Force
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Python Dependencies
run: |
pip install -U pip
pip install -r tests/requirements.txt
- name: Create Test Instance
run: |
bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }} || \
(sleep 10 && bundle exec kitchen create ${{ matrix.instance }}-${{ inputs.distro-slug }})
- name: Test Bootstrap
run: |
bundle exec kitchen verify ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Destroy Test Instance
if: always()
run: |
bundle exec kitchen destroy ${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Set Exit Status
if: always()
run: |
mkdir exitstatus
echo "${{ job.status }}" > exitstatus/${{ github.job }}-${{ matrix.instance }}-${{ inputs.distro-slug }}
- name: Upload Exit Status
if: always()
uses: actions/upload-artifact@v3
with:
name: exitstatus
path: exitstatus

View file

@ -27,7 +27,7 @@ repos:
name: Generate Github Actions Workflow name: Generate Github Actions Workflow
entry: .github/workflows/templates/generate.py entry: .github/workflows/templates/generate.py
pass_filenames: false pass_filenames: false
files: '.github/workflows/templates/.*' files: '^.github/workflows/.*$'
language: script language: script
- id: shellcheck - id: shellcheck

View file

@ -1,126 +0,0 @@
GIT
remote: https://github.com/test-kitchen/kitchen-docker.git
revision: 8d2a6f04e77b76bc9f77e0bb8cc52542743b7b6a
specs:
kitchen-docker (2.11.0)
test-kitchen (>= 1.0.0)
GEM
remote: https://rubygems.org/
specs:
bcrypt_pbkdf (1.1.0)
builder (3.2.4)
chef-utils (17.10.0)
concurrent-ruby
concurrent-ruby (1.1.10)
ed25519 (1.3.0)
erubi (1.10.0)
ffi (1.15.5)
gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.4.0)
builder (>= 2.1.2)
rexml (~> 3.0)
hashie (5.0.0)
httpclient (2.8.3)
kitchen-salt (0.7.2)
hashie (>= 3.5)
test-kitchen (>= 1.4)
kitchen-vagrant (1.11.0)
test-kitchen (>= 1.4, < 4)
license-acceptance (2.1.13)
pastel (~> 0.7)
tomlrb (>= 1.2, < 3.0)
tty-box (~> 0.6)
tty-prompt (~> 0.20)
little-plugger (1.1.4)
logging (2.3.1)
little-plugger (~> 1.1)
multi_json (~> 1.14)
mixlib-install (3.12.19)
mixlib-shellout
mixlib-versioning
thor
mixlib-shellout (3.2.7)
chef-utils
mixlib-versioning (1.2.12)
multi_json (1.15.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
nori (2.6.0)
pastel (0.8.0)
tty-color (~> 0.5)
rexml (3.2.5)
rubyntlm (0.6.3)
rubyzip (2.3.2)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
test-kitchen (3.2.2)
bcrypt_pbkdf (~> 1.0)
chef-utils (>= 16.4.35)
ed25519 (~> 1.2)
license-acceptance (>= 1.0.11, < 3.0)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 4.0)
net-scp (>= 1.1, < 4.0)
net-ssh (>= 2.9, < 7.0)
net-ssh-gateway (>= 1.2, < 3.0)
thor (>= 0.19, < 2.0)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (1.2.1)
tomlrb (2.0.3)
tty-box (0.7.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-cursor (~> 0.7)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
unicode-display_width (2.1.0)
unicode_utils (1.4.0)
winrm (2.3.6)
builder (>= 2.1.2)
erubi (~> 1.8)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.3)
winrm-elevated (1.2.3)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.5)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.1)
PLATFORMS
x86_64-linux
DEPENDENCIES
kitchen-docker!
kitchen-salt (>= 0.7.2)
kitchen-vagrant
test-kitchen (>= 3.2.2)
BUNDLED WITH
2.2.26

View file

@ -19,10 +19,10 @@ platforms:
- name: macos-1015 - name: macos-1015
suites: suites:
- name: py3-stable-3003 - name: stable-3003
provisioner: provisioner:
salt_version: 3003.4 salt_version: 3003.4
- name: py3-stable-3004 - name: stable-3004
provisioner: provisioner:
salt_version: 3004.1 salt_version: 3004.1
- name: latest - name: latest

View file

@ -17,10 +17,10 @@ platforms:
- name: windows-2019 - name: windows-2019
suites: suites:
- name: py3-stable-3003 - name: stable-3003
provisioner: provisioner:
salt_version: 3003.4-1 salt_version: 3003.4-1
- name: py3-stable-3004 - name: stable-3004
provisioner: provisioner:
salt_version: 3004.1-1 salt_version: 3004.1-1
- name: latest - name: latest

View file

@ -113,11 +113,11 @@ platforms:
run_command: /lib/systemd/systemd run_command: /lib/systemd/systemd
suites: suites:
- name: py3-git-3003 - name: git-3003
provisioner: provisioner:
salt_version: 3003 salt_version: 3003
salt_bootstrap_options: -x python3 -MPfq git %s salt_bootstrap_options: -x python3 -MPfq git %s
- name: py3-git-3004 - name: git-3004
provisioner: provisioner:
salt_version: 3004 salt_version: 3004
salt_bootstrap_options: -x python3 -MPfq git %s salt_bootstrap_options: -x python3 -MPfq git %s
@ -131,7 +131,7 @@ suites:
- freebsd-131 - freebsd-131
- freebsd-123 - freebsd-123
- openbsd-6 - openbsd-6
- name: py3-stable-3003-0 - name: stable-3003-0
provisioner: provisioner:
salt_version: 3003 salt_version: 3003
salt_bootstrap_options: -x python3 -MP stable 3003.0 salt_bootstrap_options: -x python3 -MP stable 3003.0
@ -151,7 +151,7 @@ suites:
- freebsd-131 - freebsd-131
- freebsd-123 - freebsd-123
- openbsd-6 - openbsd-6
- name: py3-stable-3003 - name: stable-3003
provisioner: provisioner:
salt_version: 3003 salt_version: 3003
salt_bootstrap_options: -x python3 -MP stable %s salt_bootstrap_options: -x python3 -MP stable %s
@ -162,7 +162,7 @@ suites:
- freebsd-131 - freebsd-131
- freebsd-123 - freebsd-123
- openbsd-6 - openbsd-6
- name: py3-stable-3004-0 - name: stable-3004-0
provisioner: provisioner:
salt_version: 3004 salt_version: 3004
salt_bootstrap_options: -x python3 -MP stable 3004.0 salt_bootstrap_options: -x python3 -MP stable 3004.0
@ -175,7 +175,7 @@ suites:
- freebsd-131 - freebsd-131
- freebsd-123 - freebsd-123
- openbsd-6 - openbsd-6
- name: py3-stable-3004 - name: stable-3004
provisioner: provisioner:
salt_version: 3004 salt_version: 3004
salt_bootstrap_options: -x python3 -MP stable %s salt_bootstrap_options: -x python3 -MP stable %s
@ -186,7 +186,7 @@ suites:
- freebsd-131 - freebsd-131
- freebsd-123 - freebsd-123
- openbsd-6 - openbsd-6
- name: py3-git-master - name: git-master
provisioner: provisioner:
salt_version: master salt_version: master
salt_bootstrap_options: -x python3 -MPfq -D git %s salt_bootstrap_options: -x python3 -MPfq -D git %s