diff --git a/.github/actions/OS_setup/action.yml b/.github/actions/OS_setup/action.yml new file mode 100644 index 00000000..c1cc9470 --- /dev/null +++ b/.github/actions/OS_setup/action.yml @@ -0,0 +1,58 @@ +name: OS-setup +description: 'Setup requested OS and python environment' +inputs: + OS: + description: OS for test + required: true + default: 'Ubuntu' + python-version: + description: python version for test + required: true + default: '3.8' + sympy-version: + description: sympy version for test + required: true + default: 'sympy' + + +runs: + using: "composite" + steps: + - uses: actions/setup-python@v3 + with: + python-version: ${{ inputs.python-version }} + - if: inputs.OS == 'ubuntu' + run: | + # use apt-spy2 to select closest apt mirror, + # which helps avoid connectivity issues in Azure; + # see https://github.com/actions/virtual-environments/issues/675 + sudo gem install apt-spy2 + sudo apt-spy2 fix --commit --launchpad --country=US + # after selecting a specific mirror, we need to run 'apt-get update' + sudo apt-get update + sudo apt-get install -y texlive-latex-base colordiff pandoc ffmpeg + shell: bash + - run: | + python -m pip install --upgrade pip setuptools + python -m pip install --upgrade nbconvert + python -m pip install testfixtures ${{ inputs.sympy-version }} mpmath jupyter matplotlib scipy nrpylatex + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + shell: bash + +# +#ubuntu 22 +# JupdevSymPy: +# python -m pip install --upgrade git+https://github.com/sympy/sympy/ +# python -m pip install testfixtures mpmath jupyter matplotlib scipy nrpylatex +# +# UnitTestdevSymPy: +# sudo apt-get install -y texlive-latex-base colordiff pandoc +# python -m pip install --upgrade git+https://github.com/sympy/sympy/ +# python -m pip install testfixtures mpmath jupyter matplotlib scipy nrpylatex +# +#ubuntu 20 +# coreJupdevSymPy: +# - name: Install dependencies +# run: | +# python -m pip install --upgrade git+https://github.com/sympy/sympy/ +# python -m pip install testfixtures mpmath jupyter matplotlib scipy nrpylatex diff --git a/.github/workflows/github-actions-MacOS12.yml b/.github/workflows/github-actions-MacOS12.yml index 5939256f..420643d9 100644 --- a/.github/workflows/github-actions-MacOS12.yml +++ b/.github/workflows/github-actions-MacOS12.yml @@ -17,16 +17,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Setup OS and python environment + uses: ./.github/actions/OS_setup with: + OS: 'Mac' python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade nbconvert - python -m pip install testfixtures sympy mpmath jupyter matplotlib scipy nrpylatex - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + sympy-version: 'sympy' - name: UnitTests run: | ./UnitTesting/run_NRPy_UnitTests.sh python3 diff --git a/.github/workflows/github-actions-ubuntu20.yml b/.github/workflows/github-actions-ubuntu20.yml index 2db0bd34..47bce760 100644 --- a/.github/workflows/github-actions-ubuntu20.yml +++ b/.github/workflows/github-actions-ubuntu20.yml @@ -18,26 +18,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Setup OS and python environment + uses: ./.github/actions/OS_setup with: + OS: 'ubuntu' python-version: ${{ matrix.python-version }} - - name: Install needed ubuntu packages - run: | - # use apt-spy2 to select closest apt mirror, - # which helps avoid connectivity issues in Azure; - # see https://github.com/actions/virtual-environments/issues/675 - sudo gem install apt-spy2 - sudo apt-spy2 fix --commit --launchpad --country=US - # after selecting a specific mirror, we need to run 'apt-get update' - sudo apt-get update - sudo apt-get install -y texlive-latex-base colordiff pandoc ffmpeg - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade nbconvert - python -m pip install testfixtures ${{ matrix.sympy-version }} mpmath jupyter matplotlib scipy nrpylatex - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + sympy-version: ${{ matrix.sympy-version }} - name: Core Jupyter notebook testsuite run: | ./UnitTesting/core_Jupyter_notebook_testsuite.sh @@ -89,26 +75,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Setup OS and python environment + uses: ./.github/actions/OS_setup with: + OS: 'ubuntu' python-version: ${{ matrix.python-version }} - - name: Install needed ubuntu packages - run: | - # use apt-spy2 to select closest apt mirror, - # which helps avoid connectivity issues in Azure; - # see https://github.com/actions/virtual-environments/issues/675 - sudo gem install apt-spy2 - sudo apt-spy2 fix --commit --launchpad --country=US - # after selecting a specific mirror, we need to run 'apt-get update' - sudo apt-get update - sudo apt-get install -y texlive-latex-base colordiff pandoc ffmpeg - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade nbconvert - python -m pip install testfixtures ${{ matrix.sympy-version }} mpmath jupyter matplotlib scipy nrpylatex - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + sympy-version: ${{ matrix.sympy-version }} - name: UnitTests run: | ./UnitTesting/run_NRPy_UnitTests.sh python diff --git a/.github/workflows/github-actions-ubuntu22.yml b/.github/workflows/github-actions-ubuntu22.yml index d4368250..552119a4 100644 --- a/.github/workflows/github-actions-ubuntu22.yml +++ b/.github/workflows/github-actions-ubuntu22.yml @@ -53,26 +53,12 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Setup OS and python environment + uses: ./.github/actions/OS_setup with: + OS: 'ubuntu' python-version: ${{ matrix.python-version }} - - name: Install needed ubuntu packages - run: | - # use apt-spy2 to select closest apt mirror, - # which helps avoid connectivity issues in Azure; - # see https://github.com/actions/virtual-environments/issues/675 - sudo gem install apt-spy2 - sudo apt-spy2 fix --commit --launchpad --country=US - # after selecting a specific mirror, we need to run 'apt-get update' - sudo apt-get update - sudo apt-get install -y texlive-latex-base colordiff pandoc ffmpeg - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade nbconvert - python -m pip install testfixtures sympy mpmath jupyter matplotlib scipy nrpylatex - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + sympy-version: 'sympy' - name: Core Jupyter notebook testsuite run: | ./UnitTesting/core_Jupyter_notebook_testsuite.sh diff --git a/.github/workflows/github-actions-windows2022.yml b/.github/workflows/github-actions-windows2022.yml index f75506a2..258c1beb 100644 --- a/.github/workflows/github-actions-windows2022.yml +++ b/.github/workflows/github-actions-windows2022.yml @@ -17,19 +17,16 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + - name: Setup OS and python environment + uses: ./.github/actions/OS_setup with: + OS: 'Windows' python-version: ${{ matrix.python-version }} + sympy-version: 'sympy' # - name: Brew install needed TeX packages (for pdflatex) # run: | # choco install texlive # choco install ffmpeg pandoc - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools - python -m pip install --upgrade nbconvert - python -m pip install testfixtures sympy mpmath jupyter matplotlib scipy nrpylatex - name: Core Jupyter notebook testsuite run: | bash ./UnitTesting/run_NRPy_UnitTests.sh python3