Skip to content

Commit

Permalink
Update Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Huulivoide committed Aug 15, 2024
1 parent bfa260d commit c443a2a
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 39 deletions.
5 changes: 2 additions & 3 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
// Note: if the rule feels generic enough, should consider adding it to the jore4 default preset
packageRules: [
{
// restrict spring boot updates to <3 versions for now
// restrict spring boot updates to <4 versions for now
groupName: "spring boot",
groupSlug: "spring-boot",
matchPackageNames: ["org.springframework.boot"],
matchPackagePrefixes: ["org.springframework.boot:"],
allowedVersions: "<3",
allowedVersions: "<4",
},
],
}
4 changes: 2 additions & 2 deletions .github/workflows/check-renovatebot-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
jobs:
validate:
name: Validate renovatebot config
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate
uses: suzuki-shunsuke/github-action-renovate-config-validator@v0.1.3
uses: suzuki-shunsuke/github-action-renovate-config-validator@v1.0.1
with:
config_file_path: .github/renovate.json5
36 changes: 11 additions & 25 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:

jobs:
run_java_tests:
name: Run Java tests
uses: ./.github/workflows/run-java-tests.yml

push_to_registry:
needs: run_java_tests
name: Build & Push docker image to Docker Hub
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand Down Expand Up @@ -71,25 +72,10 @@ jobs:
-t $IMAGE_NAME:latest \
.
run_e2e_tests:
name: Run cypress e2e tests
needs: push_to_registry
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract metadata to env variables
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1

- name: Start e2e env
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v1
with:
mapmatching_version: "${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}"
run_cypress_tests:
needs:
- run_java_tests
- push_to_registry
uses: ./.github/workflows/run-cypress-tests.yml

- name: Seed infrastructure links
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v1

- name: Run e2e tests from github action
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1
4 changes: 2 additions & 2 deletions .github/workflows/generate-jooq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
jobs:
generate-jooq:
name: Verifies whether generated jooq classes have been updated
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: "17"
java-package: jdk
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/run-cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run cypress tests

on:
# this workflow is only called by others, won't be executed on itself
workflow_call:

jobs:
run_cypress_tests:
name: Run cypress e2e tests
needs: push_to_registry
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract metadata to env variables
uses: HSLdevcom/jore4-tools/github-actions/extract-metadata@extract-metadata-v1

- name: Start e2e env
uses: HSLdevcom/jore4-tools/github-actions/setup-e2e-environment@setup-e2e-environment-v1
with:
mapmatching_version: "${{ env.IMAGE_NAME }}:${{ env.COMMIT_ID }}"

- name: Seed infrastructure links
uses: HSLdevcom/jore4-tools/github-actions/seed-infrastructure-links@seed-infrastructure-links-v1

- name: Run e2e tests from github action
uses: HSLdevcom/jore4-tools/github-actions/run-cypress-tests@run-cypress-tests-v1
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Run java tests

on:
push:
pull_request:
branches: [main]
# this workflow is only called by others, won't be executed on itself
workflow_call:

jobs:
run-tests:
name: Run java tests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -18,7 +17,7 @@ jobs:
run: ./development.sh start:devdeps

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: "17"
java-package: jdk
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
test-docker-compose:
name: verify docker-compose setup
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -euo pipefail
WD=$(dirname "$0")
cd "${WD}"

DOCKER_COMPOSE_CMD="docker-compose -f ./docker/docker-compose.yml"
DOCKER_COMPOSE_CMD="docker compose -f ./docker/docker-compose.yml"

function start_prod_database {
$DOCKER_COMPOSE_CMD up --build -d jore4-mapmatchingdb
Expand Down

0 comments on commit c443a2a

Please sign in to comment.