Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
schwarz-em committed Jun 21, 2021
0 parents commit 09d6b46
Show file tree
Hide file tree
Showing 12 changed files with 769 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/template-cleanup.yml
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 }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
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
Loading

0 comments on commit 09d6b46

Please sign in to comment.