Skip to content

Commit 8d3cccf

Browse files
authored
Merge pull request #129 from dafyddj/test-bundler
Add CI testing for Windows using GitHub Actions
2 parents 3efe81f + 2d4b79c commit 8d3cccf

File tree

3 files changed

+61
-2
lines changed

3 files changed

+61
-2
lines changed

.github/workflows/kitchen.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: CI
3+
4+
'on': [push, pull_request]
5+
6+
env:
7+
machine_user: kitchen
8+
machine_pass: Pass@word1
9+
machine_port: 5985
10+
KITCHEN_LOCAL_YAML: kitchen.github.yml
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/cache@v1
19+
with:
20+
path: vendor/bundle
21+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
22+
restore-keys: |
23+
${{ runner.os }}-gems-
24+
- shell: powershell
25+
run: |
26+
$password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
27+
New-LocalUser $env:machine_user -Password $password
28+
Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
29+
- shell: powershell
30+
run: >
31+
Set-WSManQuickConfig -Force;
32+
Set-WSManInstance -ResourceURI winrm/config/service
33+
-ValueSet @{AllowUnencrypted="true"}
34+
- run: gem install bundler --quiet --no-document
35+
- name: Bundle install
36+
run: |
37+
bundle config path vendor/bundle
38+
bundle install --jobs 4 --retry 3
39+
- run: bundle exec kitchen test

kitchen.github.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
driver:
3+
name: proxy
4+
host: localhost
5+
reset_command: "exit 0"
6+
port: 5985
7+
username: kitchen
8+
password: Pass@word1
9+
10+
platforms:
11+
- name: windows
12+
13+
provisioner:
14+
salt_install: bootstrap
15+
salt_bootstrap_options: -pythonVersion 3
16+
init_environment: >
17+
C:\salt\salt-call --local state.single file.managed
18+
C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\openvpn.sls
19+
source=https://github.com/saltstack/salt-winrepo-ng/raw/master/openvpn.sls
20+
skip_verify=True makedirs=True

openvpn/files/tap-adapter.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ if ($PSCmdlet.ParameterSetName -eq 'new') {
1212
Write-Host "changed=no comment=`'TAP-Windows adapter $New exists`'"
1313
exit
1414
}
15-
if (-Not (Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Like Eth*)) {
15+
if (-Not (Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Match "^(Ethernet|Local Area Connection)")) {
1616
$p = Start-Process $tapInstallCmd -ArgumentList $tapInstallArgs -NoNewWindow -Wait -PassThru
1717
}
18-
Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Like Eth* `
18+
Get-NetAdapter -InterfaceDescription $tapDesc | Where-Object Name -Match "^(Ethernet|Local Area Connection)" `
1919
| Select-Object -First 1 | Rename-NetAdapter -NewName $New
2020
Write-Host "changed=yes comment=`'TAP-Windows adapter $New created`'"
2121
}

0 commit comments

Comments
 (0)