dev CI #882
This file contains hidden or 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
| name: dev CI | |
| on: | |
| push: | |
| branches: [ dev ] | |
| pull_request: | |
| branches: [ dev, master ] | |
| schedule: | |
| - cron: "30 18 * * *" # run at 00:00 AM IST | |
| jobs: | |
| g8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout CSW repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: tmtsoftware/csw | |
| - uses: coursier/setup-action@v1.2.0 | |
| with: | |
| jvm: temurin:1.21 | |
| apps: sbt giter8 | |
| - uses: coursier/cache-action@v6 | |
| - name: Cache ~/.cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache | |
| key: ${{ runner.os }}-coursier-${{ hashFiles('project/Libs.scala') }} | |
| restore-keys: | | |
| ${{ runner.os }}-coursier- | |
| - name: Cache ~/.sbt | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sbt | |
| key: ${{ runner.os }}-sbt-${{ hashFiles('project/build.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-sbt- | |
| - name: Publish Local | |
| run: sbt clean publishLocal | |
| - name: Extract branch name (Trigger - PR) | |
| if: github.event_name == 'pull_request' | |
| run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV | |
| - name: Extract branch name (Trigger - Push) | |
| if: github.event_name != 'pull_request' | |
| shell: bash | |
| run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | |
| id: extract_branch | |
| - name: Set branch name (trigger - Schedule) | |
| if: github.event_name == 'schedule' | |
| run: echo "BRANCH_NAME=dev" >> $GITHUB_ENV | |
| - name: Giter8 Compile | |
| run: | | |
| echo "Running build for branch ${BRANCH_NAME}" | |
| g8 tmtsoftware/csw.g8 --name=galil --csw_version='0.1.0-SNAPSHOT' --branch ${BRANCH_NAME} | |
| cd galil | |
| sbt clean test | |
| - name: Notify slack | |
| if: always() | |
| continue-on-error: true | |
| uses: kpritam/slack-job-status-action@v1 | |
| with: | |
| job-status: ${{ job.status }} | |
| slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| channel: ci-dev |