name: Code Test on: - push - pull_request jobs: unittest: name: Code test runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: - 'ubuntu-18.04' python-version: - '3.6' - '3.7' - '3.8' - '3.9' torch-version: - '1.4.0' - '1.5.0' - '1.6.0' - '1.7.0' - '1.8.0' - '1.9.0' exclude: - os: 'ubuntu-18.04' python-version: '3.9' torch-version: '1.4.0' - os: 'ubuntu-18.04' python-version: '3.9' torch-version: '1.5.0' - os: 'ubuntu-18.04' python-version: '3.9' torch-version: '1.6.0' - os: 'ubuntu-18.04' python-version: '3.9' torch-version: '1.7.0' steps: - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 20 - name: Set up system dependences on linux if: ${{ runner.os == 'Linux' }} run: | sudo apt-get update sudo apt-get install -y tree cloc wget curl make graphviz sudo apt-get install -y libxml2-dev libxslt-dev python-dev # need by pypy3 dot -V - name: Set up python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install basic dependencies run: | python -m pip install --upgrade pip pip install --upgrade flake8 setuptools wheel twine - name: Install latest pytorch if: ${{ matrix.torch-version == 'latest' }} run: | pip install 'torch' - name: Install pytorch v${{ matrix.torch-version }} if: ${{ matrix.torch-version != 'latest' }} run: | pip install 'torch==${{ matrix.torch-version }}' - name: Install dependencies run: | pip install -r requirements.txt pip install -r requirements-test.txt - name: Test the basic environment run: | python -V pip --version pip list tree . cloc treetensor cloc test - name: Run unittest env: CI: 'true' run: | make unittest - name: Upload coverage to Codecov uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml flags: unittests name: codecov-umbrella fail_ci_if_error: false