Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Scala CLI template to example (backport #3917) #3919

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test Scala-CLI Template
name: Build and Test Scala-CLI Example

runs:
using: composite
Expand All @@ -12,21 +12,21 @@ runs:
with:
jvm: adoptium:17
apps: sbt
- name: Generate Scala CLI Template
- name: Generate Scala CLI Example
shell: bash
run: |
# Determine the version and insert it into the template
# Determine the version and insert it into the example
sbt emitVersion
VERSION=$(cat version.txt)
sed "s/@VERSION@/$VERSION/g" .github/workflows/build-scala-cli-template/chisel-template.scala > chisel-template.scala
sed "s/@VERSION@/$VERSION/g" .github/workflows/build-scala-cli-example/chisel-example.scala > chisel-example.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
sed -i '1d' chisel-example.scala
fi
# Need to publishLocal to test the template
# Need to publishLocal to test the example
- name: Publish Local
shell: bash
run: sbt "unipublish / publishLocal"
- name: Test Scala CLI Template
- name: Test Scala CLI Example
shell: bash
run: scala-cli chisel-template.scala
run: scala-cli chisel-example.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//> using repository "sonatype-s01:snapshots"
//> using scala "2.13.10"
//> using dep "org.chipsalliance::chisel::@VERSION@"
//> using plugin "org.chipsalliance:::chisel-plugin::@VERSION@"
//> using dep "org.chipsalliance::chisel:@VERSION@"
//> using plugin "org.chipsalliance:::chisel-plugin:@VERSION@"
//> using options "-unchecked", "-deprecation", "-language:reflectiveCalls", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-Ywarn-unused", "-Ymacro-annotations"

import chisel3._
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Generate Scala CLI Template
name: Generate Chisel Scala CLI Example

on:
release:
types: [created]
workflow_dispatch:

jobs:
generate_scala_cli_template:
name: Generate Scala CLI Template
generate_scala_cli_example:
name: Generate Scala CLI Example
runs-on: ubuntu-latest

steps:
Expand All @@ -16,17 +16,17 @@ jobs:
# Need to fetch full history for deriving version
with:
fetch-depth: 0
- name: Build and Test Scala-CLI Template
uses: ./.github/workflows/build-scala-cli-template
- name: Upload Template
- name: Build and Test Scala-CLI Example
uses: ./.github/workflows/build-scala-cli-example
- name: Upload Example
uses: actions/upload-artifact@v3
with:
name: chisel-template.scala
path: chisel-template.scala
name: chisel-example.scala
path: chisel-example.scala
retention-days: 7
- name: Upload To Release Page
if: github.event_name == 'release'
uses: softprops/[email protected]
with:
files: chisel-template.scala
files: chisel-example.scala

10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,25 +162,25 @@ jobs:
name: website
path: website.tar.gz

scala-cli-template:
name: Test Scala-CLI Template
scala-cli-example:
name: Test Chisel Scala-CLI Example
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Need to fetch full history for deriving version
with:
fetch-depth: 0
- name: Build and Test Scala-CLI Template
uses: ./.github/workflows/build-scala-cli-template
- name: Build and Test Chisel Scala-CLI Example
uses: ./.github/workflows/build-scala-cli-example

# Sentinel job to simplify how we specify which checks need to pass in branch
# protection and in Mergify. This job checks that all jobs were successful.
#
# When adding new jobs, please add them to `needs` below
check-tests:
name: "check tests"
needs: [mill, ci, std, integration, doc, website, scala-cli-template]
needs: [mill, ci, std, integration, doc, website, scala-cli-example]
runs-on: ubuntu-20.04
if: success() # only run if all tests have passed
outputs:
Expand Down
Loading