Try abstracting more away into composite actions
This commit is contained in:
11
.github/actions/prepare-rtl/action.yml
vendored
11
.github/actions/prepare-rtl/action.yml
vendored
@@ -21,6 +21,11 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Build toolchain
|
||||||
|
uses: ./.github/actions/toolchain-build
|
||||||
|
with:
|
||||||
|
tools-version: ${{ inputs.tools-version }}
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v2
|
||||||
id: rtl-build-id
|
id: rtl-build-id
|
||||||
with:
|
with:
|
||||||
@@ -29,13 +34,13 @@ runs:
|
|||||||
sims/firesim/sim
|
sims/firesim/sim
|
||||||
generators/gemmini/software/gemmini-rocc-tests
|
generators/gemmini/software/gemmini-rocc-tests
|
||||||
key: ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}
|
key: ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}
|
||||||
- name: run rtl build script if not cached
|
|
||||||
|
- name: Run RTL build if not cached
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then
|
if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then
|
||||||
echo "Cache miss on ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}"
|
echo "Cache miss on ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}"
|
||||||
./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }}
|
./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }}
|
||||||
else
|
else
|
||||||
echo "cache hit do not prepare rtl"
|
echo "Cache hit do not rebuild RTL for ${{ inputs.group-key }}"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
|||||||
25
.github/actions/run-tests/action.yml
vendored
25
.github/actions/run-tests/action.yml
vendored
@@ -2,6 +2,13 @@ name: run-tests
|
|||||||
description: 'Runs tests according to input parameters'
|
description: 'Runs tests according to input parameters'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
tools-version:
|
||||||
|
description: Which toolchain to build
|
||||||
|
required: false
|
||||||
|
default: 'riscv-tools'
|
||||||
|
group-key:
|
||||||
|
description: group key
|
||||||
|
required: true
|
||||||
project-key:
|
project-key:
|
||||||
description: project key
|
description: project key
|
||||||
required: true
|
required: true
|
||||||
@@ -13,8 +20,18 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: run rtl build script cache of chipyard root should have been loaded by prepare-rtl
|
- name: Build toolchain
|
||||||
run: |
|
uses: ./.github/actions/toolchain-build
|
||||||
./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
|
with:
|
||||||
shell: bash
|
tools-version: ${{ inputs.tools-version }}
|
||||||
|
|
||||||
|
# Note: You shouldn't need the other inputs since it shouldn't build RTL from scratch
|
||||||
|
- name: Build RTL
|
||||||
|
uses: ./.github/actions/toolchain-build
|
||||||
|
with:
|
||||||
|
tools-version: ${{ inputs.tools-version }}
|
||||||
|
group-key: ${{ inputs.group-key }}
|
||||||
|
|
||||||
|
- name: Run RTL tests
|
||||||
|
run: ./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
|
||||||
|
shell: bash
|
||||||
|
|||||||
14
.github/actions/ssh-checkout/action.yml
vendored
Normal file
14
.github/actions/ssh-checkout/action.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: ssh-checkout
|
||||||
|
description: "Checkout code and add SSH keys to access remote build server"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install SSH key
|
||||||
|
uses: shimataro/ssh-key-action@v2
|
||||||
|
with:
|
||||||
|
key: ${{ secrets.SERVERKEY }}
|
||||||
|
known_hosts: ${{ secrets.BUILDSERVER }}
|
||||||
50
.github/actions/toolchain-build/action.yml
vendored
50
.github/actions/toolchain-build/action.yml
vendored
@@ -6,24 +6,42 @@ inputs:
|
|||||||
description: Which toolchain to build
|
description: Which toolchain to build
|
||||||
required: false
|
required: false
|
||||||
default: 'riscv-tools'
|
default: 'riscv-tools'
|
||||||
cache-key:
|
|
||||||
description: Use this for caching
|
|
||||||
required: true
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache@v2
|
- name: Generate hashes
|
||||||
id: toolchain-build-id
|
run: .github/scripts/create-hash.sh
|
||||||
with:
|
|
||||||
path: ${{ inputs.tools-version }}-install
|
|
||||||
key: ${{ inputs.cache-key }}
|
|
||||||
- name: run build toolchain if not cached
|
|
||||||
run: |
|
|
||||||
if [[ "${{ steps.toolchain-build-id.outputs.cache-hit }}" != 'true' ]]; then
|
|
||||||
echo "Cache miss on ${{ inputs.tools-version }}-install"
|
|
||||||
./.github/scripts/build-toolchains.sh ${{ inputs.tools-version }}
|
|
||||||
else
|
|
||||||
echo "cache hit do not generate build ${{ inputs.tools-version }}"
|
|
||||||
fi
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Generate keys
|
||||||
|
id: genkey
|
||||||
|
run: |
|
||||||
|
echo "::set-output name=riscvtools-cache-key::riscv-tools-installed-${{ env.tools-cache-version }}-$(shasum riscv-tools.hash | cut -d' ' -f1)"
|
||||||
|
echo "::set-output name=esptools-cache-key::esp-tools-installed-${{ env.tools-cache-version }}-$(shasum esp-tools.hash | cut -d' ' -f1)"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
# brute force way to swap between riscv/esp-tools caches
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
id: toolchain-build-riscv-tools
|
||||||
|
if: ${{ inputs.tools-version == "riscv-tools" }}
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.tools-version }}-install
|
||||||
|
key: ${{ steps.genkey.outputs.riscvtools-cache-key }}
|
||||||
|
|
||||||
|
- uses: actions/cache@v2
|
||||||
|
id: toolchain-build-esp-tools
|
||||||
|
if: ${{ inputs.tools-version == "esp-tools" }}
|
||||||
|
with:
|
||||||
|
path: ${{ inputs.tools-version }}-install
|
||||||
|
key: ${{ steps.genkey.outputs.esptools-cache-key }}
|
||||||
|
|
||||||
|
- name: Build toolchain if not cached
|
||||||
|
run: |
|
||||||
|
if [[ "${{ steps.toolchain-build-riscv-tools.outputs.cache-hit }}" != 'true' || "${{ steps.toolchain-build-esp-tools.outputs.cache-hit }}" != 'true' ]]; then
|
||||||
|
echo "Cache miss on ${{ inputs.tools-version }}-install. Build."
|
||||||
|
./.github/scripts/build-toolchains.sh ${{ inputs.tools-version }}
|
||||||
|
else
|
||||||
|
echo "Cache hit do not rebuild toolchain ${{ inputs.tools-version }}."
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|||||||
851
.github/workflows/chipyard-run-tests.yml
vendored
851
.github/workflows/chipyard-run-tests.yml
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user