forked from chipsalliance/chisel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Change Scala-CLI Template Composite Action to Workflow (chipsall…
…iance#3457) * [ci] Scala-CLI Template Action -> Workflow, NFC Change the existing Scala-CLI composite action to a workflow. Update other workflows which now need to work a little differently. The main change is that a reusable workflow can only communicate through uploads/downloads. Hence, change the job that publishes the Scala-CLI template to download this from the new, reusable workflow. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> * [ci] Display Scala-CLI Template in Summary, NFC Show the resulting Scala-CLI template as a "GITHUB_STEP_SUMMARY" in the GitHub action for publishing it. This is likely more useful than making it available as a download artifact. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> * [ci] Whitespace cleanup, NFC Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> --------- Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
- Loading branch information
Showing
4 changed files
with
64 additions
and
55 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,51 @@ | ||
name: Build and Test Scala-CLI Template | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
build_template: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
# Need to fetch full history for deriving version | ||
with: | ||
fetch-depth: 0 | ||
- name: Install CIRCT | ||
uses: ./.github/workflows/install-circt | ||
with: | ||
github-token: ${{ github.token }} | ||
- name: Cache Scala-CLI | ||
uses: coursier/cache-action@v6 | ||
- name: Setup Scala-CLI | ||
uses: VirtusLab/scala-cli-setup@v0.2.1 | ||
with: | ||
jvm: adoptium:1.17 | ||
apps: sbt | ||
- name: Generate Scala CLI Template | ||
shell: bash | ||
run: | | ||
# Determine the version and insert it into the template | ||
sbt emitVersion | ||
VERSION=$(cat version.txt) | ||
sed "s/@VERSION@/$VERSION/g" .github/workflows/build-scala-cli-template/chisel-template.scala > chisel-template.scala | ||
# If the version does NOT contain SNAPSHOT, remove line including snapshots repo | ||
if ! grep -qi 'snapshot' <<< $VERSION; then | ||
sed -i '1d' chisel-template.scala | ||
fi | ||
# Need to publishLocal to test the template | ||
- name: Publish Local | ||
shell: bash | ||
run: sbt "unipublish / publishLocal" | ||
- name: Test Scala CLI Template | ||
shell: bash | ||
run: scala-cli chisel-template.scala | ||
- name: Upload Template | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: chisel-template.scala | ||
path: chisel-template.scala | ||
retention-days: 7 |
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
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