From ed86a4dcbe2cdb95ecdf29b87d3ce7c7ff8c8ab3 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 6 Nov 2023 11:24:26 +0000 Subject: [PATCH] Update testing (#39) * Fix metadata * Remove foodcritic * Fix markdown --------- Signed-off-by: Dan Webb --- .circleci/config.yml | 10 ------- .foodcritic | 1 - .github/workflows/ci.yml | 55 +++++++++++++++++++++++++++++++++++++ .github/workflows/stale.yml | 2 +- CHANGELOG.md | 2 ++ README.md | 35 ++++++++++------------- metadata.rb | 8 +++--- resources/edition.rb | 1 + resources/update.rb | 1 + 9 files changed, 78 insertions(+), 37 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .foodcritic create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8af810e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -version: 2.1 -orbs: - kitchen: sous-chefs/kitchen@2 -workflows: - danger: - jobs: - - kitchen/danger: - name: danger - context: Danger-Minimal diff --git a/.foodcritic b/.foodcritic deleted file mode 100644 index cf216a1..0000000 --- a/.foodcritic +++ /dev/null @@ -1 +0,0 @@ -~FC009 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ad8b314 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +--- +name: "Test" + +"on": + pull_request: + push: + branches: [main] + +jobs: + lint-unit: + uses: sous-chefs/.github/.github/workflows/lint-unit.yml@3.0.0 + permissions: + actions: write + checks: write + pull-requests: write + statuses: write + issues: write + + integration: + needs: "lint-unit" + runs-on: ubuntu-latest + strategy: + matrix: + os: + - almalinux-8 + - amazonlinux-2 + - debian-10 + - debian-11 + - centos-7 + - centos-stream-8 + - ubuntu-1804 + - ubuntu-2004 + - ubuntu-2204 + - rockylinux-8 + suite: [default] + fail-fast: false + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Install Chef + uses: actionshub/chef-install@2.0.4 + - name: Dokken + uses: actionshub/test-kitchen@2.1.0 + env: + CHEF_LICENSE: accept-no-persist + KITCHEN_LOCAL_YAML: kitchen.dokken.yml + with: + suite: ${{ matrix.suite }} + os: ${{ matrix.os }} + + final: + runs-on: ubuntu-latest + needs: [integration] + steps: + - run: echo ${{needs.integration.outputs}} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9e2ff38..4bb59c6 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -8,7 +8,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v8 with: repo-token: ${{ secrets.GITHUB_TOKEN }} close-issue-message: > diff --git a/CHANGELOG.md b/CHANGELOG.md index 25aa1ac..f157d35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This file is used to list changes made in each version of visualstudio. ## Unreleased +- Update testing + ## 2.0.2 - *2021-08-31* - Standardise files with files in sous-chefs/repo-management diff --git a/README.md b/README.md index 2226460..b0eee73 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,8 @@ -[![Cookbook Version](http://img.shields.io/cookbook/v/visualstudio.svg)](https://supermarket.chef.io/cookbooks/visualstudio) -[![Build status](https://ci.appveyor.com/api/projects/status/ttumjhmmxjo5j7gv/branch/master?svg=true)](https://ci.appveyor.com/project/ChefWindowsCookbooks65871/visualstudio/branch/master) - # VisualStudio Cookbook This Chef cookbook installs Visual Studio 2010, 2012, 2013, 2015 from an ISO. -# Requirements +## Requirements This cookbook assumes the appropriate version of the .NET framework has already been installed before running the VisualStudio cookbook. To install .NET you can use the [dotnetframework cookbook](https://supermarket.chef.io/cookbooks/dotnetframework). You must reboot the system after the .NET installation and before the VisualStudio installation. @@ -52,9 +49,9 @@ For Windows7 SP1 and Windows Server 2008 SP1 you must first install [KB2664825]( If you _really_ want to install VS 2015 on Windows Server 2012R2 over naked WinRM, you can if you first install [KB2999226](http://support.microsoft.com/kb/2999226), otherwise the VS installer will fail with error 1603. -# Attributes +## Attributes -## Optional +### Optional | Key | Type | Description | Default | |-----|------|-------------|---------| @@ -68,7 +65,7 @@ If you _really_ want to install VS 2015 on Windows Server 2012R2 over naked WinR | `['visualstudio']['install_items'][FEATURE]['selected']` | Boolean | Configures the feature on/off. This currently applies to all versions/editions being installed. | | | `['visualstudio']['2010']['professional']['config_file']` | String | The name of the Visual Studio 2010 unattend.ini template to use. | | -# Usage +## Usage Add `'visualstudio::default'` to your runlist. This will install VS 2015 Community Edition from the publicly available ISO. If you'd like to install another edition set the 'edition' attribute to: 'community', 'professional', 'premium', or 'testprofessional'. If you'd like to install a different version set the 'version' attribute to: '2010', '2012', '2013', '2015'. @@ -113,25 +110,25 @@ Do not edit the `node['visualstudio'][][]['default_install_ite Unlike newer versions of VisualStudio which use an AdminDeployment.xml file, VS 2010 uses an unattend.ini file, which, among other things, is OS-specific. By default, this cookbook uses VS 2010's `/q` option, which works for all Windows versions and specifies a default installation. To customize the installation, you may specify an unattend.ini template instead. The use of a template instead of a static file is required due to relative paths inside the file. This cookbook includes an unattend.ini template sample. -# Recipes +## Recipes -## default +### default Ensures all VisualStudio prereqs are installed first and then only runs the install recipe if they are met. You should add this recipe to your run list. -## install +### install Installs VisualStudio using the included AdminDeployment.xml or default silent install. Included by the default recipe. -## nuget +### nuget Configures the enable_nuget_package_restore environment variable. Included by the default recipe. -## dotnet_prereq +### dotnet_prereq Logs a warning if .NET 4.5.x is not installed. This recipe does not curently check for .NET 4.6. Included by the default recipe. -# Optional Recipes +## Optional Recipes ## install_update @@ -141,7 +138,7 @@ Installs VS updates from the corresponding VS update ISO that is publicly downlo Installs the Microsoft Office Developer Tools for Visual Studio 2012. Add this to your runlist if you need Office development tools for Office plugin development. Other versions of VS are not currently supported and will log a Chef warning. -# Resource/Provider +## Resource/Provider This cookbook makes the `visualstudio_edition` and `visualstudio_update` resource definitions available. @@ -159,7 +156,7 @@ visualstudio_edition 'vs_2015_professional' do end ``` -# Troubleshooting +## Troubleshooting If the installer fails very early in the install process, check a few of things: @@ -167,14 +164,14 @@ If the installer fails very early in the install process, check a few of things: - Check the VS installation log which is located in c:\program files (x86)\Microsoft Visual Studio <version>\vsinstall.log - Ensure you're not running over naked WinRM, i.e. knife-winrm or test-kitchen. Unfortunately because of the Windows security model this cookbook will not work over WinRM without a scheduled task. -# TO DO +## TO DO - Check for .NET 4.6 installed, but only if VS 2015 is going to be installed - Support VSTO on all versions of VS - More tests - Refactor duplication between cookbook helper and test helper -# Contributing +## Contributing 1. Fork the repository on Github 2. Create a named feature branch (i.e. add-vsto-support-for-vs2010) @@ -182,7 +179,3 @@ If the installer fails very early in the install process, check a few of things: 4. Write tests for your change (if applicable) 5. Run the build and ensure it passes. `bundle install && bundle exec rake && kitchen verify` 6. Submit a Pull Request - -# Author - -Author:: Shawn Neal () diff --git a/metadata.rb b/metadata.rb index a465e81..7e48311 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,8 +1,8 @@ name 'visualstudio' -maintainer 'Shawn Neal' -maintainer_email 'sneal@sneal.net' -source_url 'https://github.com/windowschefcookbooks/visualstudio' -issues_url 'https://github.com/windowschefcookbooks/visualstudio/issues' +maintainer 'Sous Chefs' +maintainer_email 'help@sous-chefs.org' +source_url 'https://github.com/sous-chefs/visualstudio' +issues_url 'https://github.com/sous-chefs/visualstudio/issues' chef_version '>= 13.0' license 'Apache-2.0' description 'Installs/Configures Visual Studio' diff --git a/resources/edition.rb b/resources/edition.rb index 3549c80..ae68141 100644 --- a/resources/edition.rb +++ b/resources/edition.rb @@ -21,6 +21,7 @@ actions :install default_action :install +unified_mode true # The VS edition: professional etc attribute :edition, kind_of: String, name_attribute: true diff --git a/resources/update.rb b/resources/update.rb index 352558f..d4a59e2 100644 --- a/resources/update.rb +++ b/resources/update.rb @@ -21,6 +21,7 @@ actions :install default_action :install +unified_mode true # The VS installation directory attribute :install_dir, kind_of: String, required: true