Skip to content

Commit

Permalink
ci: updates mega-linter config and semantic release
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelErpi committed Oct 31, 2023
1 parent 8c700e1 commit 2b5e4cd
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 56 deletions.
48 changes: 4 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,62 +26,22 @@ 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
issues: write
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
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/lint-pr-title.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DISABLE_LINTERS:
- REPOSITORY_DUSTILOCK
- SQL_TSQLLINT
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
- SQL_SQL_LINT

GROOVY_NPM_GROOVY_LINT_ARGUMENTS:
- "--failon=warning"
Expand Down
36 changes: 28 additions & 8 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
{
"type": "build",
"release": "patch"
},
{
"type": "revert",
"release": "patch"
}
]
}
Expand Down Expand Up @@ -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"]
}
]
]
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = 'org.miracum.streams.ume'
version = '0.0.1-SNAPSHOT'
version = '0.0.1'
sourceCompatibility = '17'
targetCompatibility = '17'

Expand Down
4 changes: 2 additions & 2 deletions deploy/down.sh
Original file line number Diff line number Diff line change
@@ -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)"
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app:
version: 0.0.1-SNAPSHOT
version: 0.0.0
enableCheckDigitConversion: ${CHECK_DIGIT_CONVERSION:false}

fhir:
Expand Down

0 comments on commit 2b5e4cd

Please sign in to comment.