-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reuse devcontainer image in github actions
This is needed to run benchmarking tests in CI using the same `valgrind` binaries we install in the devcontainer. Also moved the cache steps to a common action to avoid duplication.
- Loading branch information
1 parent
39955cd
commit 2f26218
Showing
12 changed files
with
350 additions
and
355 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "cache/restore" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Restore Cache" | ||
uses: "actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" | ||
with: | ||
# __SLANG_CI_CACHE_PATHS__ (keep in sync) | ||
key: "cache-${{ github.ref_name }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('package-lock.json') }}" | ||
path: | | ||
~/.cache/hermit/ | ||
~/.local/share/virtualenvs/ | ||
.hermit/ | ||
restore-keys: | | ||
cache-${{ github.ref_name }}- | ||
cache-main- | ||
cache- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "cache/save" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Repossess files from devcontainer user" | ||
shell: "bash" | ||
run: "sudo chown -R $USER:$USER $GITHUB_WORKSPACE" | ||
|
||
- name: "Save Cache" | ||
uses: "actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" | ||
with: | ||
# __SLANG_CI_CACHE_PATHS__ (keep in sync) | ||
key: "cache-${{ github.ref_name }}-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('package-lock.json') }}" | ||
path: | | ||
~/.cache/hermit/ | ||
~/.local/share/virtualenvs/ | ||
.hermit/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "benchmark" | ||
|
||
on: | ||
# Run using manual triggers from GitHub UI: | ||
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | ||
workflow_dispatch: {} | ||
|
||
# Run on pushes to any branch: | ||
push: {} | ||
|
||
# Queue up benchmark workflows for the same branch, so that results are reported in order: | ||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref_name }}" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
run: | ||
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync) | ||
|
||
# Only run on the main repo (not forks): | ||
if: "${{ github.repository == 'NomicFoundation/slang' }}" | ||
|
||
steps: | ||
- name: "Checkout Repository" | ||
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" | ||
|
||
- name: "Restore Cache" | ||
uses: "./.github/actions/cache/restore" | ||
|
||
- name: "infra setup cargo" | ||
uses: "./.devcontainer" | ||
with: | ||
entrypoint: "./scripts/bin/infra" | ||
args: "setup cargo" | ||
|
||
- name: "infra perf benchmark" | ||
uses: "./.devcontainer" | ||
with: | ||
entrypoint: "./scripts/bin/infra" | ||
args: "perf benchmark" | ||
env: | ||
BENCHER_API_TOKEN: "${{ secrets.BENCHER_API_TOKEN }}" |
Oops, something went wrong.