Update sbt to 1.10.6 #2055
Workflow file for this run
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: ['**'] | |
tags: [v*] | |
jobs: | |
ci-2-12: | |
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs | |
# do not run on internal, non-steward PRs since those will be run by push to branch | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository || | |
github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
env: | |
scala: 2.12 | |
steps: | |
- name: Check-out repository | |
id: repo-checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache SBT | |
id: cache-sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ env.scala }}-${{ hashFiles('**/build.sbt') }} | |
- name: Run tests | |
id: run-tests | |
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt "root/testOnly * -- -l org.elasticmq.rest.sqs.Only213" | |
ci-2-13: | |
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs | |
# do not run on internal, non-steward PRs since those will be run by push to branch | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository || | |
github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
env: | |
scala: 2.13 | |
steps: | |
- name: Check-out repository | |
id: repo-checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache SBT | |
id: cache-sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ env.scala }}-${{ hashFiles('**/build.sbt') }} | |
- name: Run tests | |
id: run-tests | |
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test | |
ci-3: | |
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs | |
# do not run on internal, non-steward PRs since those will be run by push to branch | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository || | |
github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
env: | |
scala: 3 | |
steps: | |
- name: Check-out repository | |
id: repo-checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache SBT | |
id: cache-sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ env.scala }}-${{ hashFiles('**/build.sbt') }} | |
- name: Run tests | |
id: run-tests | |
run: SCALA_MAJOR_VERSION=${{ env.scala }} sbt root/test | |
ci-native-image-agent-config-verification: | |
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs | |
# do not run on internal, non-steward PRs since those will be run by push to branch | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository || | |
github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
env: | |
scala: 2.13 | |
steps: | |
- name: Check-out repository | |
id: repo-checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Cache SBT | |
id: cache-sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ env.scala }}-${{ hashFiles('**/build.sbt') }} | |
- name: Build fat jar | |
run: sbt "project server; assembly" | |
- name: Build docker image for testing | |
run: docker build -t elasticmq-int -f integration-tests/docker/Dockerfile --progress=plain . | |
- name: Install dependencies | |
working-directory: ./integration-tests/python | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run integration tests | |
working-directory: ./integration-tests/python | |
run: pytest --log-cli-level=info | |
- name: Verify native image agent config files not modified | |
run: | | |
git --no-pager diff native-server/src/main/resources/META-INF/native-image/ | |
if [[ -z $(git status native-server/src/main/resources/META-INF/native-image/ --porcelain) ]]; then | |
echo "Git status is clean. No changes." | |
else | |
echo "Native image agent config files have been modified. You need to manually commit the changes to the PR" | |
exit 1 | |
fi | |
ci-docker: | |
# run on 1) push, 2) external PRs, 3) softwaremill-ci PRs | |
# do not run on internal, non-steward PRs since those will be run by push to branch | |
if: | | |
github.event_name == 'push' || | |
github.event.pull_request.head.repo.full_name != github.repository || | |
github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
env: | |
scala: 2.13 | |
steps: | |
- name: Check-out repository | |
id: repo-checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache SBT | |
id: cache-sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-${{ env.scala }}-${{ hashFiles('**/build.sbt') }} | |
- name: Compile | |
run: sbt compile | |
- name: Build jvm docker image | |
run: sbt "project server; assembly; Docker / publishLocal" | |
- name: Build native docker image | |
run: sbt "project nativeServer; Docker / publishLocal" | |
publish-jar: | |
needs: [ci-2-12, ci-2-13, ci-3, ci-docker, ci-native-image-agent-config-verification] | |
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 8 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-release-${{ hashFiles('**/build.sbt') }} | |
- name: Publish artifacts | |
run: sbt ci-release | |
env: | |
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
PGP_SECRET: ${{ secrets.PGP_SECRET }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
- name: Upload to S3 | |
run: sbt "project server; assembly; s3Upload" | |
env: | |
S3_USER: ${{ secrets.S3_USER }} | |
S3_PASSWORD: ${{ secrets.S3_PASSWORD }} | |
- name: Extract version from commit message | |
run: | | |
version=${GITHUB_REF/refs\/tags\/v/} | |
echo "VERSION=$version" >> $GITHUB_ENV | |
env: | |
COMMIT_MSG: ${{ github.event.head_commit.message }} | |
- name: Publish release notes | |
id: create_release | |
uses: release-drafter/release-drafter@v5 | |
with: | |
config-name: release-drafter.yml | |
publish: true | |
name: "v${{ env.VERSION }}" | |
tag: "v${{ env.VERSION }}" | |
version: "v${{ env.VERSION }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish assembly jar | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: "server/target/scala-2.13/elasticmq-server-assembly-${{ env.VERSION }}.jar" | |
asset_name: "elasticmq-server-all-${{ env.VERSION }}.jar" | |
asset_content_type: application/java-archive | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-docker: | |
needs: [ci-2-12, ci-2-13, ci-3, ci-docker, ci-native-image-agent-config-verification] | |
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache sbt | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.sbt | |
~/.ivy2/cache | |
~/.coursier | |
key: ${{ runner.os }}-sbt-release-${{ hashFiles('**/build.sbt') }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Publish JVM docker image | |
run: sbt "project server; assembly; Docker / publish" | |
- name: Publish JVM native docker image | |
run: sbt "project nativeServer; assembly; Docker / publish" | |
# `automerge` label is attached iff there is exactly one file changed by steward and this file belongs to a | |
# whitelist specified by `labeler.yml` | |
label: | |
name: Attach automerge label | |
# only for PRs by softwaremill-ci | |
if: github.event.pull_request.user.login == 'softwaremill-ci' | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
# count number of files changed | |
- name: Count number of files changed | |
id: count-changed-files | |
run: | | |
N=$(git diff --name-only -r HEAD^1 HEAD | wc -w) | |
echo "changed_files_num=$N" >> $GITHUB_OUTPUT | |
- name: Launch labeler | |
# skip if more than one file changed | |
if: steps.count-changed-files.outputs.changed_files_num == 1 | |
uses: srvaroa/labeler@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
auto-merge: | |
name: Auto merge | |
# only for PRs by softwaremill-ci | |
if: github.event.pull_request.user.login == 'softwaremill-ci' | |
needs: [ci-2-12, ci-2-13, ci-3, ci-docker, ci-native-image-agent-config-verification, label] | |
runs-on: ubuntu-20.04 | |
steps: | |
- id: automerge | |
name: automerge | |
uses: "pascalgn/[email protected]" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
MERGE_METHOD: "squash" |