Move Chipyard CI to Github Actions

- As similar as possible to the circle ci code.
- The `.github/README.md` file has a fair amount of documentation for this.
- Creates a worfklow file
  - re-uses most of the circleci/scipts unchanged
  - defines a number of *Composite Actions* which are like YML subroutines
- Removes the circle-ci code
- Points the CI badge in the top level README to use the GA test result
This commit is contained in:
chick
2021-10-01 14:31:02 -07:00
committed by Ella Schwarz
parent fc994c4822
commit 60ba6357a0
23 changed files with 1571 additions and 553 deletions

View File

@@ -0,0 +1,28 @@
name: build-extra-tests
description: 'Builds extra test required for some flows'
inputs:
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
cache-key:
description: Use this for caching
required: true
runs:
using: "composite"
steps:
- uses: actions/cache@v2
id: build-extra-tools-cache
with:
path: extra-tests-install
key: ${{ needs.make-keys.outputs.extra-tests-cache-key }}
restore-keys: ${{ needs.make-keys.outputs.extra-tests-cache-key }}
- name: Build extra tests if not cached
run: |
export RISCV="/__w/chipyard/chipyard/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
.github/scripts/build-extra-tests.sh
shell: bash

View File

@@ -2,13 +2,24 @@ name: prepare-rtl
description: 'Builds RTL based on parameters, caches the entire chipyard root dir when done'
inputs:
<<<<<<< HEAD
=======
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions
group-key:
description: group key
required: true
build-script:
description: rtl build script to use
required: false
<<<<<<< HEAD
default: "remote-do-rtl-build.sh"
=======
default: "do-rtl-build.sh"
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions
build-type:
description: type of build
required: false
@@ -17,9 +28,12 @@ inputs:
runs:
using: "composite"
steps:
<<<<<<< HEAD
- name: Build RISC-V toolchains
uses: ./.github/actions/toolchain-build
=======
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions
- uses: actions/cache@v2
id: rtl-build-id
with:
@@ -28,13 +42,24 @@ runs:
sims/firesim/sim
generators/gemmini/software/gemmini-rocc-tests
key: ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}
<<<<<<< HEAD
- name: Run RTL build if not cached
=======
- name: run rtl build script if not cached
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions
run: |
if [[ "${{ steps.rtl-build-id.outputs.cache-hit }}" != 'true' ]]; then
echo "Cache miss on ${{ inputs.group-key }}-${{ github.ref }}-${{ github.sha }}"
./.github/scripts/${{ inputs.build-script }} ${{ inputs.group-key }} ${{ inputs.build-type }}
else
<<<<<<< HEAD
echo "Cache hit do not rebuild RTL for ${{ inputs.group-key }}"
fi
shell: bash
=======
echo "cache hit do not prepare rtl"
fi
shell: bash
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions

View File

@@ -2,6 +2,13 @@ name: run-tests
description: 'Runs tests according to input parameters'
inputs:
<<<<<<< HEAD
=======
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions
group-key:
description: group key
required: true
@@ -16,6 +23,7 @@ inputs:
runs:
using: "composite"
steps:
<<<<<<< HEAD
- name: Init submodules (since only the RTL is cached)
run: ./scripts/init-submodules-no-riscv-tools.sh
shell: bash
@@ -29,3 +37,13 @@ runs:
- name: Run RTL tests
run: ./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
shell: bash
=======
- name: run rtl build script cache of chipyard root should have been loaded by prepare-rtl
run: |
export RISCV="/__w/chipyard/chipyard/riscv-tools-install"
export LD_LIBRARY_PATH="$RISCV/lib"
export PATH="$RISCV/bin:$PATH"
./.github/scripts/${{ inputs.run-script }} ${{ inputs.project-key }}
shell: bash
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions

View File

@@ -1,4 +1,5 @@
name: toolchain-build
<<<<<<< HEAD
description: 'Build/cache both toolchains'
runs:
@@ -49,3 +50,33 @@ runs:
- name: Build ESP RISC-V toolchain if not cached
run: ./.github/scripts/build-toolchains.sh esp-tools
shell: bash
=======
description: 'Builds the selected toolchain'
inputs:
tools-version:
description: Which toolchain to build
required: false
default: 'riscv-tools'
cache-key:
description: Use this for caching
required: true
runs:
using: "composite"
steps:
- uses: actions/cache@v2
id: toolchain-build-id
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
>>>>>>> 52c752ba... Move Chipyard CI to Github Actions