generated from chipsalliance/chisel-template
-
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.
- Loading branch information
0 parents
commit 09d6b46
Showing
12 changed files
with
769 additions
and
0 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,55 @@ | ||
# Workflow to cleanup projects created from this template | ||
# Adapted from workflow of the same name in https://github.com/JetBrains/intellij-platform-plugin-template | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Template Cleanup | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
# Triggered on first push to repos created from the template | ||
template-cleanup: | ||
name: Template Cleanup | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.name != 'chisel-template' | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cleanup | ||
run: | | ||
export LC_CTYPE=C | ||
export LANG=C | ||
# Prepare variables | ||
NAME="${GITHUB_REPOSITORY##*/}" | ||
ORG="$GITHUB_REPOSITORY_OWNER" | ||
SAFE_ORG=$(echo $ORG | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') | ||
GROUP="com.github.$SAFE_ORG" | ||
# Replace placeholders | ||
sed -i "s/%NAME%/$NAME/g" build.sbt build.sc README.md | ||
sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" README.md | ||
sed -i "s/%ORGANIZATION%/$GROUP/g" build.sbt | ||
# Remove lines marked with #REMOVE-ON-CLEANUP# | ||
sed -i '/#REMOVE-ON-CLEANUP#/d' README.md | ||
rm -rf \ | ||
.github/workflows/template-cleanup.yml \ | ||
LICENSE | ||
- name: Commit | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Template cleanup" | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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,27 @@ | ||
name: Continuous Integration | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
ci: | ||
name: ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Cleanup | ||
run: sed -i "s/%NAME%/test/g" build.sc | ||
- name: Setup Scala | ||
uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: [email protected] | ||
- name: Setup Mill | ||
uses: jodersky/[email protected] | ||
with: | ||
mill-version: 0.9.7 | ||
- name: Cache Scala | ||
uses: coursier/cache-action@v5 | ||
- name: SBT Test | ||
run: sbt test | ||
- name: mill Test | ||
run: mill _.test |
Oops, something went wrong.