chore(deps): bump dawidd6/action-download-artifact from 10 to 11 #593
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: AWS DocumentDB 5 | |
# This workflow builds and tests the Operator with Gradle. | |
on: | |
pull_request: | |
jobs: | |
test-aws-documentdb-5: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 | |
- name: Set up JDK | |
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 | |
with: | |
distribution: 'temurin' | |
java-version: 21 | |
cache: 'gradle' | |
- name: Connect DocumentDB 5 | |
env: | |
DDB5_HOST: ${{ secrets.DDB5_HOST }} # expected: sample-cluster.node.zone.docdb.amazonaws.com | |
DDB5_HOSTS_MAP: ${{ secrets.DDB5_HOSTS_MAP }} # expected: config for /etc/hosts including all propagated hostnames (master, cluster, cluster-ro) pointing to 127.0.0.1 | |
DDB_EC2_FINGERPRINT: ${{ secrets.DDB_EC2_FINGERPRINT }} # expected: hostname.ec2.proxy.to.forward.com,123.123.123.123 ecdsa-sha2-nistp256 ... | |
DDB_EC2_USER_AND_HOST: ${{ secrets.DDB_EC2_USER_AND_HOST }} # expected: username@hostname.ec2.proxy.to.forward.com | |
DDB_EC2_CERTIFICATE: ${{ secrets.DDB_EC2_CERTIFICATE }} # expected: pem certificate | |
run: > | |
mkdir -p ~/.ssh && | |
echo "${DDB_EC2_FINGERPRINT}" >> ~/.ssh/known_hosts && | |
echo "${DDB_EC2_CERTIFICATE}" > ~/.ssh/pem && | |
chmod 700 ~/.ssh && | |
chmod 400 ~/.ssh/pem && | |
ssh -i ~/.ssh/pem -L "27017:${DDB5_HOST}:27017" "${DDB_EC2_USER_AND_HOST}" -fN -M -S ddb-socket && | |
ssh -S ddb-socket -O check "${DDB_EC2_USER_AND_HOST}" && | |
sudo echo "${DDB5_HOSTS_MAP}" | sudo tee -a /etc/hosts | |
- name: Test with Gradle | |
uses: nick-fields/retry@v3 | |
env: | |
# secrets required: | |
# - secrets.DDB5_HOST # expected: sample-cluster.node.zone.docdb.amazonaws.com | |
# - secrets.DDB_USERNAME # expected: example-user | |
# - secrets.DDB_PASSWORD # expected: a-s3cr3t | |
TEST_MONGODB_CONNECTION_STRING: "mongodb://${{ secrets.DDB_USERNAME }}:${{ secrets.DDB_PASSWORD }}@${{ secrets.DDB5_HOST }}/admin?tls=false&readPreference=secondaryPreferred&retryWrites=false" | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
retry_wait_seconds: 10 | |
warning_on_retry: true | |
command: ./gradlew --continue test | |
- name: Disconnect | |
if: always() | |
run: ssh -S ddb-socket -O exit 0 | |
- name: Clean | |
if: always() | |
run: rm -rf ~/.ssh |