From 7e9e2a7cddfec941634249fb11671dbd8215ba9c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Oct 2024 11:02:58 -0700 Subject: [PATCH] python dependency fix --- .github/workflows/rpe_test.yml | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/rpe_test.yml b/.github/workflows/rpe_test.yml index 5e4d0b7d..67bd25ad 100644 --- a/.github/workflows/rpe_test.yml +++ b/.github/workflows/rpe_test.yml @@ -33,13 +33,12 @@ jobs: if: ${{ matrix.os != 'ubuntu-22.04' }} uses: actions/setup-node@v4 with: - node-version: 20.11 #if update this then also update in Dockerfile for centos + node-version: 20.11 # if update this then also update in Dockerfile for centos - name: Setup Python - if: ${{ matrix.os != 'ubuntu-22.04' }} - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5 with: - python-version: 3.8 #if update this then also update in Dockerfile for centos + python-version: 3.8 # if update this then also update in Dockerfile for centos - name: Login to the Container registry if: ${{ matrix.os == 'ubuntu-22.04' }} @@ -59,13 +58,13 @@ jobs: node --version python3 -V - - name: Shell configuration on centos 7 + - name: Shell configuration on CentOS 7 if: ${{ matrix.os == 'ubuntu-22.04' }} uses: addnab/docker-run-action@v3 with: shell: bash image: ghcr.io/${{ github.repository_owner }}/rapid_power_estimator:centos7latest - run: + run: | source /opt/rh/devtoolset-11/enable cmake --version node --version @@ -82,7 +81,7 @@ jobs: run: | npx eslint src/ - - name: Install packages centos 7 & Run pytest & frontend test + - name: Install packages CentOS 7 & Run pytest & frontend test if: ${{ matrix.os == 'ubuntu-22.04' }} uses: addnab/docker-run-action@v3 with: @@ -128,13 +127,12 @@ jobs: if: ${{ matrix.os != 'ubuntu-22.04' }} uses: actions/setup-node@v4 with: - node-version: 20.11 #if update this then also update in Dockerfile for centos + node-version: 20.11 # if update this then also update in Dockerfile for centos - name: Setup Python - if: ${{ matrix.os != 'ubuntu-22.04' }} - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v5 with: - python-version: 3.8 #if update this then also update in Dockerfile for centos + python-version: 3.8 # if update this then also update in Dockerfile for centos - name: Login to the Container registry if: ${{ matrix.os == 'ubuntu-22.04' }} @@ -154,7 +152,7 @@ jobs: node --version python3 -V - - name: Shell configuration on centos 7 + - name: Shell configuration on CentOS 7 if: ${{ matrix.os == 'ubuntu-22.04' }} uses: addnab/docker-run-action@v3 with: @@ -215,14 +213,12 @@ jobs: name: rapid_power_estimator_${{ matrix.os }} path: dist/rapid_power_estimator*.exe - - name: Upload Release if: ${{ matrix.os != 'windows-latest' && contains(github.ref, 'refs/tags/') }} uses: softprops/action-gh-release@v1 with: files: dist/rapid_power_estimator*.tar.gz - - name: Upload Release if: ${{ matrix.os == 'windows-latest' && contains(github.ref, 'refs/tags/') }} uses: softprops/action-gh-release@v1 @@ -240,13 +236,21 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 - - name: Install dependencies - run: | - pip install -r requirements.txt - npm install + - name: Set up virtual environment + run: | + python3 -m venv venv + source venv/bin/activate + + - name: Install dependencies in virtual environment + run: | + source venv/bin/activate + pip install -r requirements.txt + npm install - name: Run pytest with Codecov - run: python3 -m pytest --cov=. --cov-report=term-missing + run: | + source venv/bin/activate + python3 -m pytest --cov=. --cov-report=term-missing - name: Upload results to Codecov uses: codecov/codecov-action@v4 @@ -261,4 +265,4 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - slug: os-fpga/rapid_power_estimator \ No newline at end of file + slug: os-fpga/rapid_power_estimator