Skip to content

Commit 0a19ff9

Browse files
authored
Merge pull request #792 from FgForrest/master-build-workflow
build: syncing workflows with dev branch
2 parents c28394d + 22332b6 commit 0a19ff9

12 files changed

+123
-79
lines changed

.github/workflows/benchmark-clean.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
workflow_dispatch: # allows manual triggering
55
schedule:
66
- cron: '0 0 * * *'
7-
7+
8+
permissions:
9+
contents: read
10+
811
jobs:
912
do-benchmark-clean:
1013
runs-on: ubuntu-latest
1114

12-
steps:
13-
- uses: actions/checkout@v3 # checkout sources
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
1417

1518
- name: Install doctl
16-
uses: digitalocean/action-doctl@v2
19+
uses: digitalocean/action-doctl@135ac0aa0eed4437d547c6f12c364d3006b42824 # v2.5.1
1720
with:
18-
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
21+
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
1922

2023
- name: Run clean-benchmark
2124
env:

.github/workflows/benchmark-hook.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
types:
88
- clean-webhook
99

10+
permissions:
11+
contents: read # Required for actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 to clone the repository
12+
id-token: write # Required for authentication in certain actions (e.g., digitalocean/action-doctl@v2)
13+
secrets: read # Required to access the DIGITALOCEAN_ACCESS_TOKEN secret
14+
1015
env:
1116
KUBECONFIG: ${{ github.workspace }}/evita_performance_tests/src/do_k8s_automation/deploy/kube.cfg
1217

@@ -20,15 +25,15 @@ jobs:
2025
runs-on: ubuntu-latest
2126

2227
steps:
23-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2429

2530
- name: Install doctl
26-
uses: digitalocean/action-doctl@v2
31+
uses: digitalocean/action-doctl@135ac0aa0eed4437d547c6f12c364d3006b42824 # v2.5.1
2732
with:
2833
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
2934

3035
- name: Install kubectl
31-
uses: azure/setup-kubectl@v3
36+
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
3237
with:
3338
version: ${{ env.KUBECTL_VER }}
3439

@@ -44,7 +49,7 @@ jobs:
4449
kubectl -n evita logs job/${K8S_JOB_NAME} -c benchmark > /tmp/logs/${K8S_JOB_NAME}-log.txt || :
4550
4651
- name: Archive logs from run
47-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
4853
with:
4954
name: logs
5055
path: /tmp/logs

.github/workflows/benchmark.yml

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
types:
88
- completed
99

10+
permissions:
11+
contents: read # Required for actions/checkout to access the repository code
12+
id-token: write # May be required for accessing resources with OIDC authentication
13+
secrets: read # Required to access the secrets (e.g., DIGITALOCEAN_ACCESS_TOKEN, GRAFANA_* secrets, PERFORMANCE_GIST_TOKEN)
14+
1015
env:
1116
KUBECONFIG: ${{ github.workspace }}/evita_performance_tests/src/do_k8s_automation/deploy/kube.cfg
1217

@@ -39,15 +44,15 @@ jobs:
3944
if: ${{ github.event.workflow_run.conclusion == 'success' }}
4045

4146
steps:
42-
- uses: actions/checkout@v3 # checkout sources
47+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
4348

4449
- name: Install doctl
45-
uses: digitalocean/action-doctl@v2
50+
uses: digitalocean/action-doctl@135ac0aa0eed4437d547c6f12c364d3006b42824 # v2.5.1
4651
with:
4752
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
4853

4954
- name: Install kubectl
50-
uses: azure/setup-kubectl@v3
55+
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0
5156
with:
5257
version: ${{ env.KUBECTL_VER }}
5358

.github/workflows/ci-dev-documentation.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ jobs:
3333
runs-on: ubuntu-latest
3434

3535
steps:
36-
- uses: actions/checkout@v3 # checkout sources
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
3737

3838
- name: Setup Java JDK
39-
uses: actions/setup-java@v3 # setup JDK 17 for building
39+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 # setup JDK 17 for building
4040
with:
4141
distribution: 'temurin'
4242
java-version: '17'
4343
cache: 'maven'
4444

4545
- name: Setup dotnet
46-
uses: actions/setup-dotnet@v3
46+
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
4747
with:
4848
dotnet-version: '8.0.X' # setup dotnet 8.0.X for building
4949

@@ -52,7 +52,7 @@ jobs:
5252
mvn -T 1C -B package -P documentation -V --fail-at-end -Dmaven.test.skip=false --file pom.xml
5353
5454
- name: Publish Test Report
55-
uses: mikepenz/action-junit-report@v3
55+
uses: mikepenz/action-junit-report@ee6b445351cd81e2f73a16a0e52d598aeac2197f # v5.3.0
5656
if: success() || failure() # always run even if the previous step fails
5757
with:
5858
report_paths: '**/TEST-*.xml'

.github/workflows/ci-dev.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
runs-on: ubuntu-latest
3838

3939
steps:
40-
- uses: actions/checkout@v3 # checkout sources
40+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
4141

4242
- name: Setup Java JDK
43-
uses: actions/setup-java@v3 # setup JDK 17 for building
43+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 # setup JDK 17 for building
4444
with:
4545
distribution: 'temurin'
4646
java-version: '17'
@@ -57,25 +57,25 @@ jobs:
5757
jacoco/jacoco-summary.sh jacoco/target/site/jacoco-aggregate/jacoco.csv
5858
5959
- name: Upload test results # upload XML with unit test results to artifact `test-results` for `test-report.yml`
60-
uses: actions/upload-artifact@v4
60+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6161
if: success() || failure()
6262
with:
6363
name: test-results
6464
path: 'evita*/**/target/surefire-reports/TEST-*.xml'
6565

6666
- name: Upload evitaDB server artifact # upload `evita-server.jar` for `docker-canary.yml` to deploy to DockerHub
67-
uses: actions/upload-artifact@v4
67+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
6868
if: success()
6969
with:
7070
name: evita-server.jar
7171
path: 'evita_server/target/evita-server.jar'
7272

7373
- name: Upload coverage to Codecov # upload code coverage from Jacoco to codecov
74-
uses: codecov/codecov-action@v3
74+
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
7575

7676
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
7777
- name: Update dependency graph
78-
uses: advanced-security/maven-dependency-submission-action@v3
78+
uses: advanced-security/maven-dependency-submission-action@4f64ddab9d742a4806eeb588d238e4c311a8397d # v4.1.1
7979

8080
- name: Deploy with Maven # deploy SNAPSHOTS to Maven repository
8181
run: |

.github/workflows/ci-master.yml

+20-20
Original file line numberDiff line numberDiff line change
@@ -36,35 +36,35 @@ jobs:
3636
runs-on: ubuntu-latest
3737

3838
steps:
39-
- uses: actions/checkout@v3 # checkout sources
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
4040
with:
4141
ref: ${{ github.head_ref }}
4242
fetch-depth: 0
4343

4444
- name: Resolve new release version
4545
id: release_version
46-
uses: lukashornych/[email protected]
46+
uses: lukashornych/semantic-calendar-version@0f83ab20d3764a08d5746e6501f96c76f0a2d513 #v1.1.3
4747
with:
4848
prefix: 'v'
4949
year_switch_mode: 'OnMinor'
5050
minor-identifier: '/feat(?:\\([^)]+\\))?:/'
5151

5252
- name: Setup Java JDK
53-
uses: actions/setup-java@v3 # setup JDK 17 for building
53+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 setup JDK 17 for building
5454
with:
55-
distribution: 'temurin'
56-
java-version: '17'
57-
cache: 'maven'
58-
server-id: ossrh
59-
server-username: MAVEN_USERNAME
60-
server-password: MAVEN_CENTRAL_TOKEN
61-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
62-
gpg-passphrase: MAVEN_GPG_PASSPHRASE
55+
distribution: 'temurin'
56+
java-version: '17'
57+
cache: 'maven'
58+
server-id: ossrh
59+
server-username: MAVEN_USERNAME
60+
server-password: MAVEN_CENTRAL_TOKEN
61+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
62+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
6363

6464
- name: Build with Maven # run Maven without tests (tests must pass in dev branch)
6565
run: |
66-
export CURRENT_VERSION="${{ steps.release_version.outputs.version }}"
67-
export NEW_VERSION="$( echo ${CURRENT_VERSION} | sed 's/^v//; s/-.*//')"
66+
export SANITIZED_VERSION=$(echo "$EVITA_BUILD_VERSION" | tr -d '\r\n')
67+
export NEW_VERSION="$( echo "${SANITIZED_VERSION}" | sed 's/^v//; s/-.*//')"
6868
echo $NEW_VERSION > version.txt
6969
echo "Version: $(cat version.txt)"
7070
mvn versions:set -DnewVersion=$NEW_VERSION
@@ -84,28 +84,28 @@ jobs:
8484
cp 'evita_server/dist/logback.xml' './dist'
8585
8686
- name: Create .zip of dist
87-
uses: thedoctor0/zip-release@0.7.1
87+
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # v0.7.6
8888
with:
8989
type: 'zip'
9090
filename: 'dist.zip'
9191
path: './dist'
9292

9393
- name: Create .tar.gz of dist
94-
uses: thedoctor0/zip-release@0.7.1
94+
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # v0.7.6
9595
with:
9696
type: 'tar'
9797
filename: 'dist.tar.gz'
9898
path: './dist'
9999

100100
- name: Create release
101101
id: create_release
102-
uses: release-drafter/release-drafter@v5
102+
uses: release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
103103
with:
104104
version: ${{ steps.release_version.outputs.version }}
105105
publish: true
106106

107107
- name: Upload dist.zip to release
108-
uses: actions/upload-release-asset@v1
108+
uses: actions/upload-release-asset@64e5e85fc528f162d7ba7ce2d15a3bb67efb3d80 # v1.0.1
109109
if: success()
110110
with:
111111
upload_url: ${{ steps.create_release.outputs.upload_url }}
@@ -114,7 +114,7 @@ jobs:
114114
asset_content_type: application/zip
115115

116116
- name: Upload dist.tar.gz to release
117-
uses: actions/upload-release-asset@v1
117+
uses: actions/upload-release-asset@64e5e85fc528f162d7ba7ce2d15a3bb67efb3d80 # v1.0.1
118118
if: success()
119119
with:
120120
upload_url: ${{ steps.create_release.outputs.upload_url }}
@@ -123,14 +123,14 @@ jobs:
123123
asset_content_type: application/gzip
124124

125125
- name: Upload evitaDB server artifact # upload `evita-server.jar` for `docker-latest.yml` to deploy to DockerHub
126-
uses: actions/upload-artifact@v4
126+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
127127
if: success()
128128
with:
129129
name: evita-server.jar
130130
path: 'evita_server/target/evita-server.jar'
131131

132132
- name: Upload evitaDB version.txt # upload `version.txt` for `docker-latest.yml` to deploy to DockerHub
133-
uses: actions/upload-artifact@v4
133+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
134134
if: success()
135135
with:
136136
name: version.txt

.github/workflows/ci-performance.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
push:
77
branches: [ "performance" ] # trap each push to performance branch
88

9+
permissions:
10+
contents: read # To checkout the repository code using actions/checkout.
11+
packages: write # To publish the Docker image to the GitHub Packages registry.
12+
secrets: read # To access the secrets.
13+
914
concurrency:
1015
group: ${{ github.head_ref || github.ref_name }} # for the same branch (dev or PR)
1116
cancel-in-progress: true # run only one workflow at a time (cancel the previous)
@@ -15,10 +20,10 @@ jobs:
1520
runs-on: ubuntu-latest
1621

1722
steps:
18-
- uses: actions/checkout@v3 # checkout sources
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout sources
1924

2025
- name: Setup Java JDK
21-
uses: actions/setup-java@v3 # setup JDK 17 for building
26+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 # setup JDK 17 for building
2227
with:
2328
distribution: 'temurin'
2429
java-version: '17'

.github/workflows/docker-canary.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ on:
88
types:
99
- completed
1010

11+
permissions:
12+
contents: read # Required for actions/checkout to read the repository
13+
actions: read # Required to download artifacts from the triggering workflow
14+
packages: write # Required for pushing Docker images to DockerHub
15+
1116
jobs:
1217
on-success:
1318
runs-on: ubuntu-latest
1419
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1520
steps:
1621
- name: Checkout
17-
uses: actions/checkout@v4 # checkout from Git
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # checkout from Git
1823
with:
1924
ref: dev # Always checks out the dev branch
2025

2126
- name: Download a single artifact # download `evita-server.jar` artifact if the workflow we react to was successful
22-
uses: dawidd6/action-download-artifact@v6
27+
uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
2328
with:
2429
workflow: ${{ github.event.workflow_run.workflow_id }}
2530
workflow_conclusion: success
@@ -29,16 +34,16 @@ jobs:
2934
- name: Set up QEMU
3035
# Add support for more platforms with QEMU (optional)
3136
# https://github.com/docker/setup-qemu-action
32-
uses: docker/setup-qemu-action@v3
37+
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3.3
3338

3439
- name: Set up Docker Buildx
35-
uses: docker/setup-buildx-action@v3
40+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
3641
with:
3742
buildkitd-flags: --debug
3843
platforms: linux/amd64,linux/arm64/v8
3944

4045
- name: Login to DockerHub
41-
uses: docker/login-action@v1
46+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
4247
with:
4348
username: ${{ vars.CI_REGISTRY_USER }}
4449
password: ${{ secrets.CI_REGISTRY_PASSWORD }}
@@ -47,7 +52,7 @@ jobs:
4752
env:
4853
RELEASE_IMAGE: "evitadb:canary"
4954
EVITA_JAR_NAME: evita-server.jar
50-
uses: docker/build-push-action@v3
55+
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
5156
with:
5257
context: ./docker
5358
file: ./docker/Dockerfile

0 commit comments

Comments
 (0)