Skip to content

Commit

Permalink
TEST WSL conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
eine committed Jul 21, 2020
1 parent a86de68 commit c167722
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/wsl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'wsl'

on:
push:

jobs:

msys:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: true
install: python-pip
- uses: actions/checkout@v2
- run: python -m pip install --progress-bar off pytest
- run: ./wsl.sh
- run: python -m pytest -v -s -ra wsl.py --color=yes

mingw64:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: mingw-w64-x86_64-python-pip
- uses: actions/checkout@v2
- run: python -m pip install --progress-bar off pytest
- run: ./wsl.sh
- run: python -m pytest -v -s -ra wsl.py --color=yes
33 changes: 33 additions & 0 deletions wsl.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""
Verify that all example run scripts work correctly
"""

import sys
from sys import platform
from os import environ
from pathlib import Path
from subprocess import check_call, STDOUT
import unittest
from shutil import which


class TestExamples(unittest.TestCase):
"""
Verify that example run scripts work correctly
"""

def setUp(self):
self.shell = ['bash'] if platform == 'win32' else []

print('\n::group::Log')
sys.stdout.flush()

def tearDown(self):
print('\n::endgroup::')
sys.stdout.flush()

def _sh(self, args):
check_call(self.shell + args, stderr=STDOUT)

def test_wsl_conflict(self):
self._sh([str(Path(__file__).parent / 'wsl.sh')])
3 changes: 3 additions & 0 deletions wsl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

echo "HELLO"

0 comments on commit c167722

Please sign in to comment.