Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh actions - first pass #750

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/mac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: mac
on: [push]

jobs:
main:
name: main
runs-on: macOS-${{ matrix.os-version }}

strategy:
matrix:
os-version:
- '10.14'
python-version:
- '2.7'
- '3.6'
- '3.7'
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Verify cmake
run: |
cmake --version

- name: Verify pwsh
run: |
pwsh --version

- name: Install Rez
run: |
mkdir ./build
python ./install.py ./build

- name: Run Rez Tests
run: |
./build/bin/rez/rez-selftest
58 changes: 58 additions & 0 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: ubuntu
on: [push]

jobs:
main:
name: main
runs-on: ubuntu-${{ matrix.os-version }}

strategy:
matrix:
os-version:
- '16.04'
- '18.04'
python-version:
- '2.7'
- '3.6'
- '3.7'
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Verify cmake
run: |
cmake --version

- name: Verify pwsh
run: |
pwsh --version

- name: Install csh
run: |
sudo apt-get install -y csh

- name: Install tcsh
run: |
sudo apt-get install -y tcsh

- name: Install zsh
run: |
sudo apt-get install -y zsh

- name: Install Rez
run: |
mkdir ./build
python ./install.py ./build

- name: Run Rez Tests
run: |
./build/bin/rez/rez-selftest
45 changes: 45 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: windows
on: [push]

jobs:
main:
name: main
runs-on: windows-${{ matrix.os-version }}

strategy:
matrix:
os-version:
- '2019'
python-version:
- '2.7'
- '3.6'
- '3.7'
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Verify cmake
run: |
cmake.exe --version

- name: Verify pwsh
run: |
pwsh --version

- name: Install Rez
run: |
mkdir build
python install.py build

- name: Run Rez Tests
run: |
.\build\Scripts\rez\rez-selftest.exe
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/nerdvegas/rez.svg?branch=master)](https://travis-ci.org/nerdvegas/rez)
![](https://github.com/nerdvegas/rez/workflows/ubuntu/badge.svg)
![](https://github.com/nerdvegas/rez/workflows/mac/badge.svg)
![](https://github.com/nerdvegas/rez/workflows/windows/badge.svg)

![logo](media/rez_banner_256.png)

Expand Down
25 changes: 0 additions & 25 deletions src/rez/tests/test_logging.py

This file was deleted.

9 changes: 6 additions & 3 deletions src/rez/tests/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import os.path


solver_verbosity = 1


class TestSolver(TestBase):
@classmethod
def setUpClass(cls):
Expand All @@ -26,19 +29,19 @@ def _create_solvers(self, reqs):
s1 = Solver(reqs,
self.packages_path,
optimised=True,
verbosity=Solver.max_verbosity)
verbosity=solver_verbosity)
s2 = Solver(reqs,
self.packages_path,
optimised=False,
verbosity=Solver.max_verbosity)
verbosity=solver_verbosity)

s_perms = []
perms = itertools.permutations(reqs)
for reqs_ in perms:
s = Solver(reqs_,
self.packages_path,
optimised=True,
verbosity=Solver.max_verbosity)
verbosity=solver_verbosity)
s_perms.append(s)

return (s1, s2, s_perms)
Expand Down
15 changes: 9 additions & 6 deletions src/rez/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,17 @@ def wrapper(self, *args, **kwargs):
config.override("default_shell", shell)

try:
return func(self, *args, **kwargs)
except AssertionError as e:
func(self, *args, **kwargs)
except Exception as e:
# Add the shell to the exception message, if possible.
# In some IDEs the args do not exist at all.
if e.args:
args = list(e.args)
args[0] += " (in shell '{}')".format(shell)
e.args = tuple(args)
if hasattr(e, "args") and e.args:
try:
args = list(e.args)
args[0] += " (in shell '{}')".format(shell)
e.args = tuple(args)
except:
raise e
raise
return wrapper
return decorator
Expand Down
8 changes: 5 additions & 3 deletions src/rezplugins/shell/_utils/powershell_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,18 @@ def _record_shell(ex, files, bind_rez=True, print_msg=False):
if not isinstance(cmd, (tuple, list)):
cmd = pre_command.rstrip().split()

cmd += [self.executable]

# Suppresses copyright message of PowerShell and pwsh
cmd += [self.executable, '-NoLogo']
cmd += ["-NoLogo"]

# Generic form of sourcing that works in powershell and pwsh
cmd += ['-File', '{}'.format(target_file)]
cmd += ["-File", target_file]

if shell_command is None:
cmd.insert(1, "-NoExit")

p = popen(cmd, env=env, universal_newlines=True, **Popen_args)
p = popen(cmd, env=env, **Popen_args)
return p

def get_output(self, style=OutputStyle.file):
Expand Down