diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b4052ec..56c7979a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ permissions: read-all jobs: build: - uses: miracum/.github/.github/workflows/standard-build.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4 + uses: miracum/.github/.github/workflows/standard-build.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0 permissions: contents: read id-token: write @@ -26,48 +26,8 @@ jobs: secrets: github-token: ${{ secrets.GITHUB_TOKEN }} - test: - runs-on: ubuntu-22.04 - needs: - - build - steps: - - name: "Checkout code" - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - with: - persist-credentials: false - - - name: Download build image - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - if: ${{ github.event_name == 'pull_request' }} - with: - name: container-image - path: /tmp - - - name: load image - if: ${{ github.event_name == 'pull_request' }} - run: | - ls -lsa /tmp - docker load --input /tmp/image.tar - docker image ls - - - name: Run E2E tests - env: - FHIR_GATEWAY_IMAGE_NAME: "${{ fromJson(needs.build.outputs.image-meta-json).tags[0] }}" - run: | - docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml -f tests/e2e/docker-compose.yml --project-directory=tests/e2e build - docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml --project-directory=tests/e2e up -d - docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml -f tests/e2e/docker-compose.yml --project-directory=tests/e2e run tester - - - name: Print E2E logs - env: - FHIR_GATEWAY_IMAGE_NAME: "${{ fromJson(needs.build.outputs.image-meta-json).tags[0] }}" - if: ${{ always() }} - run: | - docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml -f tests/e2e/docker-compose.yml logs - docker compose -p e2e -f deploy/docker-compose.yml -f deploy/docker-compose.gw-deps.yml -f tests/e2e/docker-compose.yml down --volumes --remove-orphans - lint: - uses: miracum/.github/.github/workflows/standard-lint.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4 + uses: miracum/.github/.github/workflows/standard-lint.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0 permissions: contents: read pull-requests: write @@ -75,13 +35,13 @@ jobs: security-events: write actions: read with: - codeql-languages: '["java", "python"]' + codeql-languages: '["java"]' enable-codeql: true secrets: github-token: ${{ secrets.GITHUB_TOKEN }} release: - uses: miracum/.github/.github/workflows/standard-release.yaml@40fda6d89054cbb816af5784a5edf2346dcf3e62 # v1.0.4 + uses: miracum/.github/.github/workflows/standard-release.yaml@a4a6c1a49dd35e232eceaa6e583cd9665572d90b # v1.3.0 needs: - build - test diff --git a/.github/workflows/lint-pr-title.yaml b/.github/workflows/lint-pr-title.yaml new file mode 100644 index 00000000..b383740e --- /dev/null +++ b/.github/workflows/lint-pr-title.yaml @@ -0,0 +1,21 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: read-all + +jobs: + check-pr-title: + name: Validate PR title + runs-on: ubuntu-22.04 + permissions: + pull-requests: write + steps: + - uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 # v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mega-linter.yml b/.mega-linter.yml index a8c02060..f3d12660 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -20,6 +20,7 @@ DISABLE_LINTERS: - REPOSITORY_DUSTILOCK - SQL_TSQLLINT - MARKDOWN_MARKDOWN_TABLE_FORMATTER + - SQL_SQL_LINT GROOVY_NPM_GROOVY_LINT_ARGUMENTS: - "--failon=warning" diff --git a/.releaserc.json b/.releaserc.json index e48174c8..3da58616 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -20,10 +20,6 @@ { "type": "build", "release": "patch" - }, - { - "type": "revert", - "release": "patch" } ] } @@ -70,16 +66,40 @@ } } ], + "@semantic-release/github", [ - "@semantic-release/exec", + "semantic-release-replace-plugin", { - "verifyReleaseCmd": "echo ${nextRelease.version} > .VERSION" + "replacements": [ + { + "files": ["src/main/resources/application.yml"], + "from": "version: .*", + "to": "version: ${nextRelease.version}", + "results": [ + { + "file": "src/main/resources/application.yml", + "hasChanged": true + } + ] + }, + { + "files": ["build.gradle"], + "from": "version = \".*\"", + "to": "version = \"${nextRelease.version}\"", + "results": [ + { + "file": "build.gradle", + "hasChanged": true + } + ] + } + ] } ], [ - "@semantic-release/gitlab", + "@semantic-release/git", { - "gitlabUrl": "https://gitlab.miracum.org" + "assets": ["src/main/resources/application.yml", "build.gradle"] } ] ] diff --git a/build.gradle b/build.gradle index 7843084f..1cd3c431 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'org.miracum.streams.ume' -version = '0.0.1-SNAPSHOT' +version = '0.0.1' sourceCompatibility = '17' targetCompatibility = '17' diff --git a/deploy/down.sh b/deploy/down.sh index d201cf5c..62ebfb9f 100644 --- a/deploy/down.sh +++ b/deploy/down.sh @@ -1,3 +1,3 @@ #!/bin/sh -docker stop $(docker ps -a | grep -v "oracle" | awk 'NR>1 {print $1}') -docker rm $(docker ps -a -q -f status=exited) +docker stop "$(docker ps -a | grep -v "oracle" | awk 'NR>1 {print $1}')" +docker rm "$(docker ps -a -q -f status=exited)" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0fb1181e..d843ed80 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ app: - version: 0.0.1-SNAPSHOT + version: 0.0.0 enableCheckDigitConversion: ${CHECK_DIGIT_CONVERSION:false} fhir: