Use container for python 3.6 compatibility issue #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: build-and-test | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.6"] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 30 | |
| container: ${{ matrix.os == 'ubuntu-latest' && 'ubuntu:20.04' || '' }} | |
| steps: | |
| - name: Prepare tools (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| apt-get update | |
| apt-get install -y git ca-certificates curl gnupg software-properties-common | |
| add-apt-repository ppa:deadsnakes/ppa -y | |
| apt-get update | |
| apt-get install -y python3.6 python3.6-dev python3.6-distutils | |
| curl -sSL https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3.6 | |
| python3.6 -m pip install --upgrade pip | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch core files from open_dev branch | |
| shell: bash | |
| run: | | |
| git fetch origin open_dev | |
| git checkout origin/open_dev -- _core | |
| - name: Set up Python 3.6 (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.6" | |
| - name: Install dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| python3.6 -m pip install cython setuptools | |
| python3.6 -m pip install -r requirements.txt | |
| python3.6 -m pip install pytest | |
| - name: Install dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| python -m pip install cython setuptools | |
| python -m pip install -r requirements.txt | |
| python -m pip install pytest | |
| - name: Copy core files to geatpy/core (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| mkdir -p geatpy/core | |
| cp -r "_core/Linux/lib64/v3.6/"* geatpy/core/ | |
| - name: Copy core files to geatpy/core (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path geatpy/core | Out-Null | |
| Copy-Item -Recurse -Force "_core\Windows\lib64\v3.6\*" "geatpy\core\" | |
| - name: Build (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: python3.6 setup.py install | |
| - name: Build (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: python setup.py install | |
| - name: Test with pytest (Linux) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| python3.6 -m geatpy --version | |
| python3.6 -m pytest | |
| - name: Test with pytest (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| python -m geatpy --version | |
| python -m pytest |