2.113.0 (2023-09-11) #114
Workflow file for this run
This file contains 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
# Run resolving benchmark and store results. Fail if any resolved runtimes | |
# change from previous result | |
# | |
name: benchmark | |
on: | |
release: | |
types: [released] | |
jobs: | |
run_benchmark: | |
name: run_benchmark | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- '2.7' | |
- '3.7' | |
# without this, we're sometimes getting at the end of this job: | |
# '[error] The operation was canceled'. | |
# Do we hit a resource limit? | |
# | |
max-parallel: 1 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
os: ubuntu-latest | |
- name: Install Rez | |
run: | | |
mkdir ./installdir | |
if [[ "${{ matrix.python-version }}" == "2.7" ]]; then | |
eval "$(conda shell.bash hook)" | |
conda activate python | |
fi | |
python ./install.py ./installdir | |
- name: Run Benchmark | |
run: | | |
./installdir/bin/rez/rez-benchmark --out ./out | |
# remove benchmarking suite package repo | |
rm -rf ./out/packages | |
- name: Validate Result | |
run: | | |
if [[ "${{ matrix.python-version }}" == "2.7" ]]; then | |
eval "$(conda shell.bash hook)" | |
conda activate python | |
fi | |
python ./.github/scripts/validate_benchmark.py | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "benchmark-result-${{ matrix.python-version }}" | |
path: ./out | |
store_benchmark_result: | |
name: store_benchmark_result | |
runs-on: ubuntu-latest | |
needs: run_benchmark | |
strategy: | |
matrix: | |
python-version: | |
- '2.7' | |
- '3.7' | |
# so we don't have jobs trying to push to git at the same time | |
max-parallel: 1 | |
steps: | |
- name: Setup python ${{ matrix.python-version }} | |
uses: ./.github/actions/setup-python | |
with: | |
python-version: ${{ matrix.python-version }} | |
os: ubuntu | |
- uses: actions/download-artifact@v3 | |
with: | |
name: "benchmark-result-${{ matrix.python-version }}" | |
path: . | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
path: src | |
# This is a PAT from an Admin user. We do this in order to be able to write to a | |
# protected branch (main) from this workflow. | |
# See https://github.community/t/how-to-push-to-protected-branches-in-a-github-action/16101/14 | |
# | |
token: "${{ secrets.GH_ACTION_TOKEN }}" | |
# Note failing due to | |
# https://github.com/actions/virtual-environments/issues/675 | |
# | |
# We'll just skip on failure, this just means the gnuplot doesn't render | |
# | |
- name: Install gnuplot | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y gnuplot || /bin/true | |
- name: Store Benchmark Result | |
run: | | |
if [[ "${{ matrix.python-version }}" == "2.7" ]]; then | |
eval "$(conda shell.bash hook)" | |
conda activate python | |
fi | |
python ./.github/scripts/store_benchmark.py | |
working-directory: src | |
- name: Setup git config | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
working-directory: src | |
- name: Git commit and push | |
run: | | |
if [[ "$(git status --porcelain)" == "" ]]; then | |
echo "Nothing new to commit" | |
else | |
git add --all | |
git commit -m "Generated from GitHub "${{ github.workflow }}" Workflow" | |
git push origin main | |
fi | |
working-directory: src |