Skip to content

Commit

Permalink
Switch Windows workflow to WSL (#55)
Browse files Browse the repository at this point in the history
* change cryptography installation

* Change cryptography to pacman package

* Add noconfigm pacman

* Use pip3

* Add ensurepip

* fix package name

* add PATH echo

* fix typo

* test WSL replacement

* add python package wsl

* python3

* remove ensurepip

* Update deploy pipeline to WSL
  • Loading branch information
j91321 authored Jan 7, 2023
1 parent 3c2dc50 commit dd70335
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/ansible-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ jobs:
- uses: actions/checkout@v2
with:
path: "ansible-role-sysmon"
- uses: msys2/setup-msys2@v2
- uses: Vampire/setup-wsl@v1
with:
update: true
install: base-devel git gcc msys2-devel python3 python3-pip libffi libffi-devel libcrypt libcrypt-devel openssl openssl-devel
distribution: Ubuntu-22.04
additional-packages:
python3
python3-pip
- name: Download ConfigureRemotingForAnsible.ps1
run: wget https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -Outfile ConfigureRemotingForAnsible.ps1
shell: powershell
Expand All @@ -63,13 +65,13 @@ jobs:
Enable-LocalUser -Name "Ansible"
shell: powershell
- name: Update pip and setuptools
shell: msys2 {0}
run: CFLAGS=-I/usr/lib/libffi-3.2.1/include python -m pip install --upgrade pip setuptools
shell: wsl-bash {0}
run: python3 -m pip install --upgrade pip setuptools
- name: Install Ansible
shell: msys2 {0}
run: CFLAGS=-I/usr/lib/libffi-3.2.1/include python -m pip install cryptography==3.3.2 wheel ansible pywinrm
shell: wsl-bash {0}
run: python3 -m pip install wheel setuptools-rust ansible pywinrm
- name: Run Ansible playbook
shell: msys2 {0}
shell: wsl-bash {0}
run: |
ansible-playbook -i ansible-role-sysmon/.github/scripts/inventory ansible-role-sysmon/.github/scripts/playbook.yml
- name: Run test script
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/ansible-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ jobs:
- uses: actions/checkout@v2
with:
path: "ansible-role-sysmon"
- uses: msys2/setup-msys2@v2
- uses: Vampire/setup-wsl@v1
with:
update: true
install: base-devel git gcc msys2-devel python3 python3-pip libffi libffi-devel libcrypt libcrypt-devel openssl openssl-devel
distribution: Ubuntu-22.04
additional-packages:
python3
python3-pip
- name: Download ConfigureRemotingForAnsible.ps1
run: wget https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -Outfile ConfigureRemotingForAnsible.ps1
shell: powershell
Expand All @@ -65,14 +67,17 @@ jobs:
Add-LocalGroupMember -Group Administrators -Member Ansible
Enable-LocalUser -Name "Ansible"
shell: powershell
- name: Echo $PATH
shell: wsl-bash {0}
run: echo $PATH
- name: Update pip and setuptools
shell: msys2 {0}
run: CFLAGS=-I/usr/lib/libffi-3.2.1/include python -m pip install --upgrade pip setuptools
shell: wsl-bash {0}
run: python3 -m pip install --upgrade pip setuptools
- name: Install Ansible
shell: msys2 {0}
run: CFLAGS=-I/usr/lib/libffi-3.2.1/include python -m pip install cryptography==3.3.2 wheel setuptools-rust ansible pywinrm
shell: wsl-bash {0}
run: python3 -m pip install wheel setuptools-rust ansible pywinrm
- name: Run Ansible playbook
shell: msys2 {0}
shell: wsl-bash {0}
run: |
ansible-playbook -i ansible-role-sysmon/.github/scripts/inventory ansible-role-sysmon/.github/scripts/playbook.yml
- name: Run test script
Expand Down

0 comments on commit dd70335

Please sign in to comment.