Enabling ACPU UI to enable/disable ACPU Power and Fix Python Dependency Issues #1050
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
| name: Build and Publish RPE | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - '*' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - ubuntu-22.04 | |
| - macos-12 | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| MODE: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.11 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Login to the Container registry | |
| if: ${{ matrix.os == 'ubuntu-22.04' }} | |
| uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull the CentOS image | |
| if: ${{ matrix.os == 'ubuntu-22.04' }} | |
| run: docker pull ghcr.io/${{ github.repository_owner }}/rapid_power_estimator:centos7latest | |
| - name: Shell configuration on ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: | | |
| node --version | |
| python3 -V | |
| - 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: | | |
| source /opt/rh/devtoolset-11/enable | |
| cmake --version | |
| node --version | |
| python3 -V | |
| - name: Install packages ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: | | |
| npm install | |
| python3 -m pip install -r requirements.txt | |
| - name: Run ESLint only on ubuntu-latest | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| run: | | |
| npx eslint src/ | |
| - name: Install packages CentOS 7 & Run pytest & frontend test | |
| 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 | |
| options: -v ${{ github.workspace }}:/work | |
| run: | | |
| cd /work | |
| npm install | |
| python3 -m pip install -r requirements.txt | |
| python3 -m pytest | |
| npm test | |
| - name: Run pytest on ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: python3 -m pytest | |
| - name: Run frontend unit test on ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: | | |
| npm test | |
| publish: | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-22.04 | |
| - macos-12 | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| packages: read | |
| env: | |
| MODE: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.11 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Login to the Container registry | |
| if: ${{ matrix.os == 'ubuntu-22.04' }} | |
| uses: docker/[email protected] | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Pull the CentOS image | |
| if: ${{ matrix.os == 'ubuntu-22.04' }} | |
| run: docker pull ghcr.io/${{ github.repository_owner }}/rapid_power_estimator:centos7latest | |
| - name: Shell configuration on ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: | | |
| node --version | |
| python3 -V | |
| - 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: | | |
| source /opt/rh/devtoolset-11/enable | |
| cmake --version | |
| node --version | |
| python3 -V | |
| - name: Install packages ${{ matrix.os }} | |
| if: ${{ matrix.os != 'ubuntu-22.04' }} | |
| run: | | |
| npm install | |
| python3 -m pip install -r requirements.txt | |
| - name: Create Package on ${{ matrix.os }} | |
| if: ${{ matrix.os == 'macos-12' || matrix.os == 'windows-latest' }} | |
| run: | | |
| npm run dist | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Package on Linux | |
| 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 | |
| options: -v ${{ github.workspace }}:/work | |
| run: | | |
| cd /work | |
| npm install | |
| python3 -m pip install -r requirements.txt | |
| npm run dist | |
| ls dist | |
| tar -czvf rapid_power_estimator_linux.tar.gz -C dist/linux-unpacked . | |
| mv rapid_power_estimator_linux.tar.gz dist | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run on refs/tags only | |
| run: | | |
| echo ${{ github.ref }} | |
| - name: Upload Package | |
| if: ${{ github.ref == 'refs/heads/main' && matrix.os != 'windows-latest' }} | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: rapid_power_estimator_${{ matrix.os }} | |
| path: dist/rapid_power_estimator*.tar.gz | |
| - name: Upload Package | |
| if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'windows-latest' }} | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| 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 | |
| with: | |
| files: dist/rapid_power_estimator*.exe | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - 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: | | |
| source venv/bin/activate | |
| python3 -m pytest --cov=. --cov-report=term-missing | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: os-fpga/rapid_power_estimator | |
| - name: Run npm test with Codecov | |
| run: npm test | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| slug: os-fpga/rapid_power_estimator |