-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove hard coded repo setting from CI
- Loading branch information
Showing
1 changed file
with
19 additions
and
16 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 |
---|---|---|
|
@@ -24,6 +24,7 @@ permissions: | |
|
||
env: | ||
EXERCISES_DIRECTORY: ./exercises | ||
THIS_REPO: ${{ github.event.repository.name }} | ||
|
||
jobs: | ||
list-exercises: | ||
|
@@ -34,7 +35,6 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- id: list | ||
run: echo "::set-output name=exercises::$(ls $EXERCISES_DIRECTORY | grep exercise_ | jq -cnR '[inputs | select(length>0)]')" | ||
# run: echo "name=exercises::$(ls $EXERCISES_DIRECTORY | grep exercise_ | jq -cnR '[inputs | select(length>0)]')" >> $GITHUB_OUTPUT | ||
|
||
validate_course: | ||
runs-on: ubuntu-latest | ||
|
@@ -52,8 +52,12 @@ jobs: | |
cache: 'sbt' | ||
distribution: 'temurin' | ||
|
||
- name: Check code formatting | ||
run: sbt scalafmtCheckAll | ||
working-directory: ${{env.EXERCISES_DIRECTORY}}/${{matrix.exercise}} | ||
|
||
- name: Test with sbt | ||
run: sbt 'set scalaVersion := "3.0.0"' test | ||
run: sbt test | ||
working-directory: ${{env.EXERCISES_DIRECTORY}}/${{matrix.exercise}} | ||
|
||
validate_course_summary: | ||
|
@@ -76,14 +80,14 @@ jobs: | |
- name: Checkout Course Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
path: cmt-template-scala3 | ||
path: ${{ env.THIS_REPO }} | ||
fetch-depth: 0 | ||
|
||
- name: Setup Course Management Tools | ||
uses: robinraju/[email protected] | ||
with: | ||
repository: lunatech-labs/course-management-tools | ||
tag: "2.0.0-RC10" | ||
tag: "2.0.0" | ||
fileName: "course-management-tools.zip" | ||
out-file-path: "." | ||
- run: | | ||
|
@@ -99,23 +103,23 @@ jobs: | |
- name: Setup Coursier Cache | ||
uses: coursier/[email protected] | ||
with: | ||
root: "cmt-template-scala3" | ||
root: ${{ env.THIS_REPO }} | ||
|
||
- name: Studentify Repo | ||
run: | | ||
mkdir -p studentified | ||
export PATH=${PATH}:$GITHUB_WORKSPACE/CMT/bin | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Lunatech Labs" | ||
cmta studentify -f -g -m cmt-template-scala3 -d studentified | ||
(cd studentified && exec zip -r cmt-template-scala3-student.zip cmt-template-scala3) | ||
cmta studentify -f -g -m ${{ env.THIS_REPO }} -d studentified | ||
(cd studentified && exec zip -r ${{ env.THIS_REPO }}-student.zip ${{ env.THIS_REPO }}) | ||
- name: Linearize Repo | ||
run: | | ||
mkdir -p linearized | ||
cmta linearize -f -m cmt-template-scala3 -d linearized | ||
mv linearized/cmt-template-scala3 linearized/cmt-template-scala3-linearized | ||
(cd linearized && exec zip -r cmt-template-scala3-linearized.zip cmt-template-scala3-linearized) | ||
cmta linearize -f -m ${{ env.THIS_REPO }} -d linearized | ||
mv linearized/${{ env.THIS_REPO }} linearized/${{ env.THIS_REPO }}-linearized | ||
(cd linearized && exec zip -r ${{ env.THIS_REPO }}-linearized.zip ${{ env.THIS_REPO }}-linearized) | ||
- name: Create Github Release | ||
id: create_release | ||
|
@@ -134,18 +138,17 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # release created from previous step | ||
asset_path: ./studentified/cmt-template-scala3-student.zip | ||
asset_name: cmt-template-scala3-student.zip | ||
asset_path: ./studentified/${{ env.THIS_REPO }}-student.zip | ||
asset_name: ${{ env.THIS_REPO }}-student.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Linearized repo to Github release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # release created from previous step | ||
asset_path: ./linearized/cmt-template-scala3-linearized.zip | ||
asset_name: cmt-template-scala3-linearized.zip | ||
asset_path: ./linearized/${{ env.THIS_REPO }}-linearized.zip | ||
asset_name: ${{ env.THIS_REPO }}-linearized.zip | ||
asset_content_type: application/zip | ||
|
||
|