Skip to content

Commit

Permalink
Move install script here
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus committed Jan 21, 2025
1 parent 5706dcd commit 9fc10c4
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 82 deletions.
46 changes: 46 additions & 0 deletions .github/actions/chef-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Install Chef'
description: 'Installs Chef products on Windows or Linux/macOS'

inputs:
channel:
description: 'Chef download channel'
required: false
default: 'stable'
project:
description: 'Chef project to download'
required: false
default: 'chef-workstation'
version:
description: 'Version of Chef product'
required: false
license-id:
description: 'Chef license ID'
required: true
windows-path:
description: 'Windows installation path'
required: false
default: 'C:\opscode'

runs:
using: "composite"
steps:
- name: Install Chef on Linux/macOS
if: runner.os != 'Windows'
shell: bash
run: |
curl -L https://chefdownload-commercial.chef.io/install.sh?license_id=${{ inputs.license-id }} -o chefDownload.sh
sudo chmod +x chefDownload.sh
sudo ./chefDownload.sh -c ${{ inputs.channel }} -P ${{ inputs.project }} ${{ inputs.version && format('-v {0}', inputs.version) }}
rm -f chefDownload.sh
- name: Install Chef on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
. { iwr -useb https://chefdownload-commercial.chef.io/install.ps1?license_id=${{ inputs.license-id }} } | iex;
install -channel ${{ inputs.channel }} -project ${{ inputs.project }} ${{ inputs.version && format('-version {0}', inputs.version) }}
- name: Add Windows Chef Path
if: runner.os == 'Windows'
shell: pwsh
run: echo "${{ inputs.windows-path }}\bin" >> $env:GITHUB_PATH
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,43 @@ inputs:
chef-version:
description: 'Chef version to use'
required: false
default: 'latest'
chef-license:
description: 'Chef license acceptance'
required: false
default: 'accept-no-persist'
default: 'current'
license-id:
description: 'Chef license ID'
required: true
kitchen-command:
description: 'Kitchen command to run (test, verify, etc)'
required: false
default: 'test'
channel:
description: 'Chef download channel'
required: false
default: 'stable'
project:
description: 'Chef project to download'
required: false
default: 'chef-workstation'
version:
description: 'Version of Chef product'
required: false
windows-path:
description: 'Windows installation path'
required: false
default: 'C:\opscode'

runs:
using: "composite"
steps:
- name: Install Chef
uses: actionshub/chef-install@3.0.1
uses: ./.github/actions/chef-install
with:
version: ${{ inputs.chef-version }}
license-id: ${{ inputs.license-id }}

- name: Run Test Kitchen
shell: bash
run:
kitchen ${{ inputs.kitchen-command }} ${{ inputs.suite }}-${{ inputs.os }}
run: kitchen ${{ inputs.kitchen-command }} ${{ inputs.suite }}-${{ inputs.os }}
env:
CHEF_LICENSE: ${{ inputs.chef-license }}
CHEF_LICENSE: ${{ inputs.license-id }}
KITCHEN_LOCAL_YAML: ${{ inputs.kitchen-yaml }}
KITCHEN_YAML: ${{ inputs.kitchen-yaml }}
File renamed without changes.
148 changes: 75 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,52 @@ jobs:
statuses: write
issues: write

integration:
needs: lint-unit
runs-on: ubuntu-22.04
strategy:
matrix:
os:
- almalinux-9
- almalinux-10
- amazonlinux-2023
- centos-stream-9
- centos-stream-10
- debian-11
- debian-12
- fedora-latest
- opensuse-leap-15
- oraclelinux-8
- oraclelinux-9
- ubuntu-2204
- ubuntu-2404
suite:
- "installation-script-main"
- "installation-script-test"
- "installation-package"
- "installation-tarball"
- "install-and-stop"
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Test Kitchen
uses: ./.github/actions/test-kitchen
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
kitchen-yaml: kitchen.dokken.yml
chef-version: latest
chef-license: accept-no-persist
# integration:
# needs: lint-unit
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# os:
# - almalinux-9
# - almalinux-10
# - amazonlinux-2023
# - centos-stream-9
# - centos-stream-10
# - debian-11
# - debian-12
# - fedora-latest
# - opensuse-leap-15
# - oraclelinux-8
# - oraclelinux-9
# - ubuntu-2204
# - ubuntu-2404
# suite:
# - "installation-script-main"
# - "installation-script-test"
# - "installation-package"
# - "installation-tarball"
# - "install-and-stop"
# fail-fast: false
# steps:
# - name: Check out code
# uses: actions/checkout@v4
# - name: Test Kitchen
# uses: ./.github/actions/test-kitchen
# with:
# suite: ${{ matrix.suite }}
# os: ${{ matrix.os }}
# kitchen-yaml: kitchen.dokken.yml
# chef-version: latest
# license-id: ${{ secrets.CHEF_LICENSE_KEY }}

integration-swarm:
needs: lint-unit
# needs: lint-unit
runs-on: ubuntu-22.04
strategy:
matrix:
os: ["ubuntu-2204"]
suite: ["swarm"]
fail-fast: false

steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -76,38 +75,41 @@ jobs:
os: ${{ matrix.os }}
kitchen-yaml: kitchen.yml
chef-version: latest
chef-license: accept-no-persist
license-id: ${{ secrets.CHEF_LICENSE_KEY }}

integration-smoke:
needs: lint-unit
runs-on: ubuntu-latest
strategy:
matrix:
os:
- "almalinux-8"
- "almalinux-9"
- "debian-11"
- "debian-12"
- "rockylinux-8"
- "rockylinux-9"
- "ubuntu-2004"
- "ubuntu-2204"
- "ubuntu-2404"
suite:
- "smoke"
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup VirtualBox & Vagrant
uses: ./.github/workflows/virtualbox-setup.yml
- name: Install Chef
uses: actionshub/[email protected]
- name: Test Kitchen
uses: ./.github/actions/test-kitchen
with:
suite: ${{ matrix.suite }}
os: ${{ matrix.os }}
kitchen-yaml: kitchen.yml
chef-version: latest
chef-license: accept-no-persist
# integration-smoke:

Check warning on line 80 in .github/workflows/ci.yml

View workflow job for this annotation

GitHub Actions / lint-unit / runner / yamllint

80:3 [comments-indentation] comment not indented like content
# needs: lint-unit
# runs-on: ubuntu-latest
# strategy:
# matrix:
# os:
# - "almalinux-8"
# - "almalinux-9"
# - "debian-11"
# - "debian-12"
# - "rockylinux-8"
# - "rockylinux-9"
# - "ubuntu-2004"
# - "ubuntu-2204"
# - "ubuntu-2404"
# suite:
# - "smoke"
# fail-fast: false
# steps:
# - name: Check out code
# uses: actions/checkout@v4
# - name: Setup VirtualBox & Vagrant
# uses: ./.github/actions/virtualbox-setup
# - name: Install Chef
# uses: actionshub/[email protected]
# with:
# version: latest
# license-id: ${{ env.CHEF_LICENSE_KEY }}
# - name: Test Kitchen
# uses: ./.github/actions/test-kitchen
# with:
# suite: ${{ matrix.suite }}
# os: ${{ matrix.os }}
# kitchen-yaml: kitchen.yml
# chef-version: latest
# license-id: ${{ env.CHEF_LICENSE_KEY }}

0 comments on commit 9fc10c4

Please sign in to comment.