diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index afef3e3b422..fae51f10920 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -65,11 +65,13 @@ jobs: -e GITHUB_TOKEN=$GITHUB_TOKEN \ -e GITHUB_ACTIONS=true \ -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ + -e GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH \ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ -e GITHUB_REF=$GITHUB_REF \ -e GITHUB_SHA=${GITHUB_SHA} \ --workdir /opt/workspace \ -v "${workspace}:/opt/workspace" \ + -v "${GITHUB_EVENT_PATH}:${GITHUB_EVENT_PATH}" \ ${BASE_OS}:${BASE_DISTRO} - name: 'Setting up dependencies' run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 13eb8a2728b..731a14ca624 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -179,6 +179,18 @@ jobs: restore-keys: | ${{ runner.os }}-maven- + - name: Mac Dependencies + run: | + # Via: https://github.com/ledger/ledger/commit/1eec9f86667cad3b0bbafb82a83739a0d30ca09f + # Unlink and re-link to prevent errors when github mac runner images + # install python outside of brew, for example: + # https://github.com/orgs/Homebrew/discussions/3895 + # https://github.com/actions/setup-python/issues/577 + # https://github.com/actions/runner-images/issues/6459 + # https://github.com/actions/runner-images/issues/6507 + # https://github.com/actions/runner-images/issues/2322 + brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done + - name: Build brew bottle id: build env: @@ -255,6 +267,18 @@ jobs: name: homebrew path: homebrew-k-old + - name: Mac Dependencies + run: | + # Via: https://github.com/ledger/ledger/commit/1eec9f86667cad3b0bbafb82a83739a0d30ca09f + # Unlink and re-link to prevent errors when github mac runner images + # install python outside of brew, for example: + # https://github.com/orgs/Homebrew/discussions/3895 + # https://github.com/actions/setup-python/issues/577 + # https://github.com/actions/runner-images/issues/6459 + # https://github.com/actions/runner-images/issues/6507 + # https://github.com/actions/runner-images/issues/2322 + brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done + - name: 'Test brew bottle' id: test env: diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 9e19850cbdb..bb61aa1de1f 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -192,10 +192,12 @@ jobs: -e GITHUB_TOKEN=$GITHUB_TOKEN \ -e GITHUB_ACTIONS=true \ -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ + -e GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH \ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ -e GITHUB_REF=$GITHUB_REF \ --workdir /opt/workspace \ -v "${workspace}:/opt/workspace" \ + -v "${GITHUB_EVENT_PATH}:${GITHUB_EVENT_PATH}" \ ${BASE_OS}:${BASE_DISTRO} - name: 'Install K from Package' run: | diff --git a/flake.lock b/flake.lock index f3ea59ffce9..59f800c4543 100644 --- a/flake.lock +++ b/flake.lock @@ -160,16 +160,17 @@ ] }, "locked": { - "lastModified": 1689018333, - "narHash": "sha256-sthxx50rj0E7gv38oeMj8GZOp7i1776P1qZsM7pVLd0=", + "lastModified": 1656435814, + "narHash": "sha256-Gx4QoWB9eI437/66iqTr6AUjxGgN6WslqrQ57s+sL6A=", "owner": "goodlyrottenapple", "repo": "mavenix", - "rev": "153d69e62f87e5dd37d35492cc3e35dd80d2b5fa", + "rev": "0cbd57b2494d52909b27f57d03580acc66bf0298", "type": "github" }, "original": { "owner": "goodlyrottenapple", "repo": "mavenix", + "rev": "0cbd57b2494d52909b27f57d03580acc66bf0298", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 92a44f2f542..0ce3cc86651 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ nixpkgs.follows = "haskell-backend/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; mavenix = { - url = "github:goodlyrottenapple/mavenix"; + url = "github:goodlyrottenapple/mavenix/0cbd57b2494d52909b27f57d03580acc66bf0298"; inputs.nixpkgs.follows = "haskell-backend/nixpkgs"; inputs.utils.follows = "flake-utils"; }; diff --git a/k-distribution/tests/profiling/post_results_to_develop.py b/k-distribution/tests/profiling/post_results_to_develop.py index 21716a86ba9..357d70054ba 100755 --- a/k-distribution/tests/profiling/post_results_to_develop.py +++ b/k-distribution/tests/profiling/post_results_to_develop.py @@ -2,6 +2,7 @@ import json import sys import subprocess +from slugify import slugify COMMIT_SHA = sys.argv[1] FROM_BRANCH='' @@ -38,18 +39,17 @@ def execute_command(command): print("Exporting last bencher report from", FROM_BRANCH, "to", TO_BRANCH) +# Remove any special characters from the branch name to get the slug +FROM_BRANCH = slugify(FROM_BRANCH) + # This command will generate a JSON file with a list containing the last reports # sorted in descendenting order for the project. -bencher_command = ["bencher", "report", "list", "--project", "k-framework", - "--sort", "date_time", "--direction", "desc", "--per-page", - "255"] -data = json.loads(execute_command(bencher_command)) - -# Collect all elemnts where the key 'project' is 'k_framework' -k_framework = [item for item in data if item['project']['slug'] == 'k-framework' - and item['branch']['slug'] == FROM_BRANCH] +bencher_command = ["bencher", "report", "list", "--project", "k-framework", + "--branch", FROM_BRANCH, "--sort", "date_time", + "--direction", "desc"] +reports = json.loads(execute_command(bencher_command)) -print("Found", len(k_framework), "reports for k-framework in", FROM_BRANCH) +print("Found", len(reports), "reports for k-framework in", FROM_BRANCH) # Append the last 6 reports to the list, they correspond to the last performance # execution on the last commit in FROM_BRANCH @@ -58,7 +58,7 @@ def get_name_and_value(item): data = {} for i in range(0,6): - item = k_framework[i] + item = reports[i] results = item['results'] benchmark_name = results[0][0]['benchmarks'][0]['name'] metric_name_memory, value_memory = get_name_and_value(results[0][0]) diff --git a/k-distribution/tests/profiling/setup_profiling.sh b/k-distribution/tests/profiling/setup_profiling.sh index 1fa3000f8f4..f4a109ca6b6 100755 --- a/k-distribution/tests/profiling/setup_profiling.sh +++ b/k-distribution/tests/profiling/setup_profiling.sh @@ -3,14 +3,15 @@ set -euxo pipefail export DEBIAN_FRONTEND=noninteractive -export BENCHER_VERSION="0.3.10" +export BENCHER_VERSION="0.3.15" apt-get update apt-get upgrade --yes -apt-get install --yes python3 git curl make time sudo wget +apt-get install --yes python3 python3-pip git curl make time sudo wget # Build K if no flag was given and don't execute if flag was given if [ $# -eq 0 ]; then apt-get install --yes ./kframework.deb fi +python3 -m pip install python-slugify wget https://github.com/bencherdev/bencher/releases/download/v"${BENCHER_VERSION}"/bencher_"${BENCHER_VERSION}"_amd64.deb sudo dpkg -i bencher_"${BENCHER_VERSION}"_amd64.deb