Testing Master workflow (scalesim-project/SCALE-Sim)
The Testing Master workflow from scalesim-project/SCALE-Sim, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Testing Master workflow from the scalesim-project/SCALE-Sim repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Testing Master
on:
push:
branches:
- main
- dev
- dev-ramulator-merge
pull_request:
branches:
- main
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update Ubuntu
run: sudo apt update
- name: Install Dependencies
run: sudo apt install python3 python3-venv
- name: Create Venv
run: python3 -m venv venv && source venv/bin/activate
- name: install setuptools
run: source venv/bin/activate && pip3 install setuptools
- name: other packages
run: source venv/bin/activate && pip3 install -r requirements.txt && pip3 install pylint
- name: Install SCALE-Sim
run: source venv/bin/activate && python3 setup.py install
- name: Install tkinter
run: sudo apt-get install python3-tk
- name: Linting
run: source venv/bin/activate && python3 -m pylint --fail-under=7.5 scalesim/
continue-on-error: true
# To test the default SCALE-Sim run
- name: Run default SCALE-Sim configuration
run: |
source venv/bin/activate && python3 scalesim/scale.py
deactivate
continue-on-error: true
# To test the functionality of weight stationary dataflow in estimate bandwidth mode
- name: Run general script file for estimate bandwidth mode and ws dataflow
run: |
source venv/bin/activate
chmod +x ./test/general/scripts/diff_calc.sh
./test/general/scripts/diff_calc.sh
shell: bash
continue-on-error: true
# To test the functionality of weight stationary dataflow in user bandwidth mode
- name: Run general script file for user bandwidth mode and ws dataflow
run: |
source venv/bin/activate
chmod +x ./test/general/scripts/diff_user_ws.sh
./test/general/scripts/diff_user_ws.sh
shell: bash
continue-on-error: true
# To test the functionality of input stationary dataflow in user bandwidth mode
- name: Run general script file for user bandwidth mode and is dataflow
run: |
source venv/bin/activate
chmod +x ./test/general/scripts/diff_user_is.sh
./test/general/scripts/diff_user_is.sh
shell: bash
continue-on-error: true
# To test the functionality of output stationary dataflow in user bandwidth mode
- name: Run general script file for user bandwidth mode and os dataflow
run: |
source venv/bin/activate
chmod +x ./test/general/scripts/diff_user_os.sh
./test/general/scripts/diff_user_os.sh
shell: bash
continue-on-error: true
# To test sparsity functionality
- name: Run sparsity script file
run: |
source venv/bin/activate
chmod +x ./test/sparsity/scripts/function_test.sh
./test/sparsity/scripts/function_test.sh
shell: bash
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Testing Master on: push: branches: - main - dev - dev-ramulator-merge pull_request: branches: - main - dev concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout uses: actions/checkout@v2 - name: Update Ubuntu run: sudo apt update - name: Install Dependencies run: sudo apt install python3 python3-venv - name: Create Venv run: python3 -m venv venv && source venv/bin/activate - name: install setuptools run: source venv/bin/activate && pip3 install setuptools - name: other packages run: source venv/bin/activate && pip3 install -r requirements.txt && pip3 install pylint - name: Install SCALE-Sim run: source venv/bin/activate && python3 setup.py install - name: Install tkinter run: sudo apt-get install python3-tk - name: Linting run: source venv/bin/activate && python3 -m pylint --fail-under=7.5 scalesim/ continue-on-error: true # To test the default SCALE-Sim run - name: Run default SCALE-Sim configuration run: | source venv/bin/activate && python3 scalesim/scale.py deactivate continue-on-error: true # To test the functionality of weight stationary dataflow in estimate bandwidth mode - name: Run general script file for estimate bandwidth mode and ws dataflow run: | source venv/bin/activate chmod +x ./test/general/scripts/diff_calc.sh ./test/general/scripts/diff_calc.sh shell: bash continue-on-error: true # To test the functionality of weight stationary dataflow in user bandwidth mode - name: Run general script file for user bandwidth mode and ws dataflow run: | source venv/bin/activate chmod +x ./test/general/scripts/diff_user_ws.sh ./test/general/scripts/diff_user_ws.sh shell: bash continue-on-error: true # To test the functionality of input stationary dataflow in user bandwidth mode - name: Run general script file for user bandwidth mode and is dataflow run: | source venv/bin/activate chmod +x ./test/general/scripts/diff_user_is.sh ./test/general/scripts/diff_user_is.sh shell: bash continue-on-error: true # To test the functionality of output stationary dataflow in user bandwidth mode - name: Run general script file for user bandwidth mode and os dataflow run: | source venv/bin/activate chmod +x ./test/general/scripts/diff_user_os.sh ./test/general/scripts/diff_user_os.sh shell: bash continue-on-error: true # To test sparsity functionality - name: Run sparsity script file run: | source venv/bin/activate chmod +x ./test/sparsity/scripts/function_test.sh ./test/sparsity/scripts/function_test.sh shell: bash
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.