Skip to content

Commit

Permalink
reuse devcontainer image in github actions
Browse files Browse the repository at this point in the history
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
OmarTawfik committed Aug 2, 2024
1 parent 54c9067 commit a72f4d6
Show file tree
Hide file tree
Showing 15 changed files with 344 additions and 354 deletions.
18 changes: 18 additions & 0 deletions .github/actions/cache/restore/action.yml
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-
18 changes: 18 additions & 0 deletions .github/actions/cache/save/action.yml
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/
25 changes: 25 additions & 0 deletions .github/actions/devcontainer/run/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "devcontainer/run"

inputs:
runCmd:
type: "string"
required: true

# TODO: this is a workaround for https://github.com/devcontainers/ci/pull/295
# Will remove and replace with 'inheritEnv' once the fix is released
env:
type: "string"
default: ""

runs:
using: "composite"
steps:
- name: "Run in devcontainer"
uses: "devcontainers/ci@a56d055efecd725e8cfe370543b6071b79989cc8"
with:
configFile: ".devcontainer/devcontainer.json"
env: |
CI
${{ inputs.env }}
push: "never"
runCmd: "${{ inputs.runCmd }}"
56 changes: 0 additions & 56 deletions .github/workflows/_jobs_ci.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/_jobs_github_pages.yml

This file was deleted.

100 changes: 0 additions & 100 deletions .github/workflows/_jobs_publish.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/_jobs_sanctuary.yml

This file was deleted.

Loading

0 comments on commit a72f4d6

Please sign in to comment.