Skip to content

Commit

Permalink
update secret usage in workflows + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaAltieri committed Feb 16, 2024
1 parent fc2c80c commit 3105406
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
16 changes: 2 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ on:
- cron: "53 0 * * *" # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
workflow_call:
secrets:
CHARMHUB_TOKEN:
required: true
AWS_ACCESS_KEY:
required: true
AWS_SECRET_KEY:
required: true
GCP_ACCESS_KEY:
required: true
GCP_SECRET_KEY:
required: true

jobs:
lint:
Expand Down Expand Up @@ -82,9 +71,8 @@ jobs:
integration-test:
name: Integration test charm
needs:
# comment out temporarily to test workflow on GitHub faster
# - lint
# - unit-test
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ on:
jobs:
ci-tests:
uses: ./.github/workflows/ci.yaml
secrets:
CHARMHUB_TOKEN: "${{ secrets.CHARMHUB_TOKEN }}"
AWS_ACCESS_KEY: "${{ secrets.AWS_ACCESS_KEY }}"
AWS_SECRET_KEY: "${{ secrets.AWS_SECRET_KEY }}"
GCP_ACCESS_KEY: "${{ secrets.GCP_ACCESS_KEY }}"
GCP_SECRET_KEY: "${{ secrets.GCP_SECRET_KEY }}"
secrets: inherit

build:
name: Build charm
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/backup_tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ async def count_failed_backups(db_unit: ops.model.Unit) -> int:
async def set_credentials(ops_test: OpsTest, github_secrets, cloud: str) -> None:
"""Sets the s3 crednetials for the provided cloud, valid options are AWS or GCP."""
# set access key and secret keys
access_key = github_secrets[f"{cloud}_ACCESS_KEY_ID"]
secret_key = github_secrets[f"{cloud}_SECRET_ACCESS_KEY"]
access_key = github_secrets[f"{cloud}_ACCESS_KEY"]
secret_key = github_secrets[f"{cloud}_SECRET_KEY"]
assert access_key and secret_key, f"{cloud} access key and secret key not provided."

s3_integrator_unit = ops_test.model.applications[S3_APP_NAME].units[0]
Expand Down

0 comments on commit 3105406

Please sign in to comment.