Skip to content

Commit

Permalink
feat: Update workflows
Browse files Browse the repository at this point in the history
- Use reusable workflows
- Use release-please for releasing gem

Signed-off-by: Dan Webb <dan.webb@damacus.io>
  • Loading branch information
damacus committed Nov 25, 2023
1 parent a9995e7 commit 3795ab3
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 52 deletions.
49 changes: 5 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,15 @@ name: Lint & Unit

"on":
pull_request:
push:
branches:
- main

jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Run yaml Lint
uses: actionshub/yamllint@main

chefstyle:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
ruby: ["3.1"]
name: Chefstyle on Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: r7kamura/rubocop-problem-matchers-action@v1
- run: bundle exec chefstyle

unit:
name: Unit test on Ruby ${{ matrix.ruby }}
needs: [yamllint, chefstyle]
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["2.7", "3.0", "3.1"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rake spec
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main

integration-windows:
name: Windows ${{matrix.suite}} ${{matrix.os}}
runs-on: windows-latest
needs: unit
needs: lint-unit
strategy:
fail-fast: false
matrix:
Expand All @@ -69,7 +30,7 @@ jobs:
integration-linux:
name: Linux ${{matrix.suite}} ${{matrix.os}}
runs-on: ubuntu-latest
needs: unit
needs: lint-unit
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -106,7 +67,7 @@ jobs:
integration-capabilities:
name: Linux ${{matrix.suite}} ${{matrix.os}}
runs-on: ubuntu-latest
needs: unit
needs: lint-unit
strategy:
fail-fast: false
matrix:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: release-please

"on":
push:
branches: [main]

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: ruby
package-name: workflow-testing-gem
version-file: lib/kitchen/driver/docker_version.rb
token: ${{ secrets.PORTER_GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}

- name: Build and publish to GitHub Package
uses: actionshub/publish-gem-to-github@main
if: ${{ steps.release.outputs.release_created }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ secrets.OWNER }}

- name: Build and publish to RubyGems
uses: actionshub/publish-gem-to-rubygems@main
if: ${{ steps.release.outputs.release_created }}
with:
token: ${{ secrets.RUBYGEMS_API_KEY }}
8 changes: 8 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
default: true
MD013: false
MD024: false
MD026: false
MD036: false
MD012: false
MD029: false
MD004: false
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,21 @@ Examples:

If you are using the InSpec verifier on Windows, using named pipes for the Docker engine will not work with the Docker transport.
Set the socket option with the TCP socket address of the Docker engine as shown below:

```yaml
socket: tcp://localhost:2375
```

The Docker engine must be configured to listen on a TCP port (default port is 2375). This can be configured by editing the configuration file
(usually located in `C:\ProgramData\docker\config\daemon.json`) and adding the hosts value:
```

```json
"hosts": ["tcp://0.0.0.0:2375"]
```

Example configuration is shown below:
```

```json
{
"registry-mirrors": [],
"insecure-registries": [],
Expand Down Expand Up @@ -171,6 +174,7 @@ Configuration section for more details).
The isolation technology for the container. This is not set by default and will use the default container isolation settings.

For example, the following driver configuration options can be used to specify the container isolation technology for Windows containers:

```yaml
# Hyper-V
isolation: hyperv
Expand Down Expand Up @@ -238,6 +242,7 @@ driver_config:
provision_command: curl -L https://www.opscode.com/chef/install.sh | bash
require_chef_omnibus: false
```

### env_variables

Adds environment variables to Docker container
Expand Down Expand Up @@ -376,6 +381,7 @@ Examples:
- 8.8.8.8
- 8.8.4.4
```

### http\_proxy

Sets an http proxy for the suite container using the `http_proxy` environment variable.
Expand All @@ -385,6 +391,7 @@ Examples:
```yaml
http_proxy: http://proxy.host.com:8080
```

### https\_proxy

Sets an https proxy for the suite container using the `https_proxy` environment variable.
Expand All @@ -394,6 +401,7 @@ Examples:
```yaml
https_proxy: http://proxy.host.com:8080
```

### forward

Set suite container port(s) to forward to the host machine. You may specify
Expand Down Expand Up @@ -525,11 +533,11 @@ Share a host device with the container. Host device must be an absolute path.

Examples:

```
```yaml
devices: /dev/vboxdrv
```

```
```yaml
devices:
- /dev/vboxdrv
- /dev/vboxnetctl
Expand Down Expand Up @@ -637,6 +645,7 @@ example:

## License

```text
Copyright 2013-2016, [Sean Porter](https://github.com/portertech)
Copyright 2015-2016, [Noah Kantrowitz](https://github.com/coderanger)
Expand All @@ -651,14 +660,12 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

[issues]: https://github.com/test-kitchen/kitchen-docker/issues
[license]: https://github.com/test-kitchen/kitchen-docker/blob/master/LICENSE
[repo]: https://github.com/test-kitchen/kitchen-docker
[docker_installation]: https://docs.docker.com/installation/#installation
[docker_upstart_issue]: https://github.com/dotcloud/docker/issues/223
[docker_index]: https://index.docker.io/
[docker_default_image]: https://index.docker.io/_/base/
[test_kitchen_docs]: https://kitchen.ci/docs/getting-started/introduction/
[chef_omnibus_dl]: https://downloads.chef.io/chef-client/
[cpu_shares]: https://docs.fedoraproject.org/en-US/Fedora/17/html/Resource_Management_Guide/sec-cpu.html
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task default: [:quality]

# Create the spec task.
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec, :tag) do |t, args|
RSpec::Core::RakeTask.new(:test, :tag) do |t, args|
t.rspec_opts = [].tap do |a|
a << "--color"
a << "--format #{ENV["CI"] ? "documentation" : "Fuubar"}"
Expand Down
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

0 comments on commit 3795ab3

Please sign in to comment.