Run changelog verification only for PRs (#50) #191
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: Test | |
| # Controls when the workflow will run | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| push: | |
| branches: [ master ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '8' | |
| distribution: 'adopt' | |
| - name: Cache SBT | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.ivy2/cache | |
| ~/.sbt | |
| key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt', 'project/**') }} | |
| - name: load-here-secret | |
| env: | |
| OLP_CREDENTIALS: ${{ secrets.OLP_CREDENTIALS }} | |
| run: mkdir -p ~/.here/ && echo $OLP_CREDENTIALS | base64 --decode > ~/.here/credentials.properties | |
| - name: load-ivy2-secret | |
| env: | |
| SBT_CREDENTIALS: ${{ secrets.SBT_CREDENTIALS }} | |
| run: mkdir -p ~/.ivy2/ && echo $SBT_CREDENTIALS | base64 --decode > ~/.ivy2/.credentials | |
| - name: scripted-test-psv | |
| run: sbt ';sbt-bom / scripted psv/*' -Dsbt.boot.credentials="~/.ivy2/.credentials" | |
| - name: scripted-test-sv | |
| if: github.ref == 'refs/heads/master' | |
| run: sbt ';sbt-bom / scripted sv/*' -Dsbt.boot.credentials="~/.ivy2/.credentials" | |
| - name: test | |
| run: sbt clean coverageOn coverage test coverageReport | |
| - name: update-version | |
| run: | | |
| CURRENT_VERSION=$(git fetch &>/dev/null; git tag -l --sort=taggerdate | grep -vE '[a-zA-Z]' | tail -n 1) | |
| echo "CURRENT_VERSION=${CURRENT_VERSION}" | tee current-version.env | |
| sed -i "s/0.0.0-SNAPSHOT/$CURRENT_VERSION/g" version.sbt | |
| - name: package | |
| run: sbt package |