Storage Integration #19
This file contains 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: Storage Tests | |
on: | |
push: | |
branches: | |
- main | |
- master | |
pull_request: | |
env: | |
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | |
# aws args | |
AWS_REGION: "${{ secrets.AWS_REGION }}" | |
PYTHON_VERSION: "3.11" | |
AWS_CLOUD_BUCKET_NAME: "${{ secrets.AWS_CLOUD_BUCKET_NAME }}" | |
# gcs args | |
GOOGLE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_ACCOUNT_JSON_BASE64 }} | |
GCS_CLOUD_BUCKET_NAME: "${{ secrets.GCS_CLOUD_BUCKET_NAME }}" | |
#azure args | |
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }} | |
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
AZURE_CLOUD_BUCKET_NAME: "${{ secrets.AZURE_CLOUD_BUCKET_NAME }}" | |
jobs: | |
aws-rust-lints-test: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
OPSML_SERVER_PORT: 3000 | |
OPSML_STORAGE_URI: s3://${{ secrets.AWS_CLOUD_BUCKET_NAME }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Set up Rust | |
run: rustup override set stable && rustup update | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo clippy | |
working-directory: ./crates | |
run: cargo clippy --workspace --all-targets -- -D warnings | |
- name: Run test script in the background | |
run: ./crates/test.sh & | |
- name: Wait for service to be available | |
run: | | |
until curl --output /dev/null --silent --head --fail http://localhost:3000; do | |
echo "Waiting for the service to be available..." | |
sleep 5 | |
done | |
- name: Tests | |
working-directory: ./crates | |
run: | | |
make test.storage.aws.http | |
env: | |
RUST_BACKTRACE: 1 | |
OPSML_TRACKING_URI: http://localhost:3000 | |
- name: Shutdown Docker Compose services | |
run: docker-compose down | |
gcs-rust-lints-test: | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
OPSML_SERVER_PORT: 8080 | |
OPSML_STORAGE_URI: gs://${{ secrets.GCS_CLOUD_BUCKET_NAME }} | |
GOOGLE_ACCOUNT_JSON_BASE64: ${{ secrets.GOOGLE_ACCOUNT_JSON_BASE64 }} | |
runs-on: ubuntu-latest | |
needs: aws-rust-lints-test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
run: rustup override set stable && rustup update | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo clippy | |
working-directory: ./crates | |
run: cargo clippy --workspace --all-targets -- -D warnings | |
- name: Tests | |
working-directory: ./crates | |
run: | | |
make test.storage.gcs.client | |
env: | |
RUST_BACKTRACE: 1 | |
azure-rust-lints-test: | |
needs: gcs-rust-lints-test | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
OPSML_STORAGE_URI: az://${{ secrets.AZURE_CLOUD_BUCKET_NAME }} | |
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Az CLI login" | |
uses: azure/login@v2 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Set up Rust | |
run: rustup override set stable && rustup update | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo clippy | |
working-directory: ./crates | |
run: cargo clippy --workspace --all-targets -- -D warnings | |
- name: Tests | |
working-directory: ./crates | |
run: | | |
make test.storage.azure.client | |
sleep 5 | |
make test.storage.azure.http | |
env: | |
RUST_BACKTRACE: 1 |