Add some method. #87
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
| # @see https://github.com/ohze/sbt-devops/blob/main/files/sbt-devops.yml | |
| name: sbt-devops | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-18.04 | |
| outputs: | |
| commitMsg: ${{ steps.commitMsg.outputs.msg }} | |
| strategy: | |
| matrix: | |
| java: [ '8', '11', '17' ] | |
| couchbase: [ '4.6.5', '5.0.1' ] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - id: commitMsg | |
| run: echo "::set-output name=msg::$(git show -s --format=%s $GITHUB_SHA)" | |
| - uses: actions/setup-java@v2 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: 'temurin' | |
| - uses: coursier/cache-action@v6 | |
| - run: sbt devopsQA | |
| - run: | | |
| docker run -d \ | |
| --ulimit nofile=40960:40960 \ | |
| --ulimit core=100000000:100000000 \ | |
| --ulimit memlock=100000000:100000000 \ | |
| --name cb \ | |
| --net=host \ | |
| -v `pwd`/cb-test-prepare.sh:/cb-test-prepare.sh \ | |
| couchbase:enterprise-${{ matrix.couchbase }} | |
| for i in {1..5}; do | |
| docker exec -e CB=${{ matrix.couchbase }} cb /cb-test-prepare.sh && break || sleep 8; | |
| done | |
| working-directory: . | |
| shell: bash | |
| - run: sbt test | |
| # https://www.scala-sbt.org/1.x/docs/GitHub-Actions-with-sbt.html#Caching | |
| - run: | | |
| rm -rf "$HOME/.ivy2/local" || true | |
| find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true | |
| find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true | |
| find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true | |
| find $HOME/.sbt -name "*.lock" -delete || true | |
| shell: bash | |
| publish: | |
| needs: build | |
| if: | | |
| success() && | |
| github.event_name == 'push' && | |
| (github.ref == 'refs/heads/7.x' || | |
| github.ref == 'refs/heads/8.x' || | |
| github.ref == 'refs/heads/9.x' || | |
| github.ref == 'refs/heads/master' || | |
| startsWith(github.ref, 'refs/tags/')) | |
| runs-on: ubuntu-20.04 | |
| outputs: | |
| info: ${{ steps.info.outputs.info }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '8' | |
| - run: sbt versionCheck ci-release | |
| env: | |
| PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
| PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| # optional | |
| #CI_CLEAN: '; clean ; sonatypeBundleClean' | |
| #CI_RELEASE: '+publishSigned' | |
| #CI_SONATYPE_RELEASE: 'sonatypeBundleRelease' | |
| #CI_SNAPSHOT_RELEASE: '+publish' | |
| - id: info | |
| run: echo "::set-output name=info::$(cat "$GITHUB_WORKSPACE/target/publish.info")" | |
| notify: | |
| needs: [build, publish] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: docker://ohze/devops-notify | |
| env: | |
| # You can use `DEVOPS_` | `SLACK_` prefix for `MATTERMOST_*` envs below | |
| # ex SLACK_WEBHOOK_URL instead of MATTERMOST_WEBHOOK_URL | |
| MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} | |
| # optional. See https://developers.mattermost.com/integrate/incoming-webhooks/#parameters | |
| #MATTERMOST_ICON: icon_url or icon_emoji | |
| #MATTERMOST_CHANNEL: use default of the webhook if not set | |
| #MATTERMOST_USERNAME: use default of the webhook if not set | |
| #MATTERMOST_PRETEXT: Message shown above the CI status attachment, ex to mention some user. Default empty. | |
| _DEVOPS_NEEDS: ${{ toJSON(needs) }} |