Skip to content

Commit

Permalink
Add the logic into integration-tests.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Oct 4, 2023
1 parent de2d7eb commit 2d2b7bf
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
runs-on: ${{ matrix.platform }}

steps:
# Configure longpath names if on Windows
# Configure longpath names if on Windows
- name: Enable Longpaths if on Windows
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
Expand Down
34 changes: 33 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,44 @@ jobs:
test-run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

steps:
# Configure longpath names if on Windows
- name: Enable Longpaths if on Windows
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
shell: pwsh

- uses: actions/setup-java@v3
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.jdk }}

- uses: actions/checkout@v4
- name: Checkout Security Repo
uses: actions/checkout@v4

- name: Insert Admin Credential on Linux
if: ${{ runner.os == 'Linux' }}
run: |
cat <<EOL >> /home/runner/work/security/security/config/internal_users.yml
admin:
hash: "$2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG"
reserved: true
backend_roles:
- "admin"
description: "Demo admin user"
EOL
shell: bash

- name: Add Admin Credential on Windows
if: ${{ runner.os == 'Windows' }}
run: |
$filePath = "D:\a\security\security\config\internal_users.yml"
Add-Content -Path $filePath -Value "admin:"
Add-Content -Path $filePath -Value " hash: `"$2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG`""
Add-Content -Path $filePath -Value " reserved: true"
Add-Content -Path $filePath -Value " backend_roles:"
Add-Content -Path $filePath -Value " - `"admin`""
Add-Content -Path $filePath -Value " description: `"Demo admin user`""
shell: pwsh

- run: OPENDISTRO_SECURITY_TEST_OPENSSL_OPT=true ./gradlew test

Expand Down

0 comments on commit 2d2b7bf

Please sign in to comment.