diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f2e0d5b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: AZ_TEST + +on: + pull_request: + +permissions: + id-token: write + contents: read + +jobs: + test: + runs-on: ubuntu-22.04 + steps: + - name: Log into Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + + - name: Fetch secrets + run: | + az keyvault secret show --vault-name bpfperformacesecrets --name PGDATABASE --query value | sed 's/"//g' > ${{github.workspace}}/PGDATABASE + az keyvault secret show --vault-name bpfperformacesecrets --name PGHOST --query value | sed 's/"//g' >> ${{github.workspace}}/PGHOST + az keyvault secret show --vault-name bpfperformacesecrets --name PGUSER --query value | sed 's/"//g' >> ${{github.workspace}}/PGUSER + az keyvault secret show --vault-name bpfperformacesecrets --name PGPASSWORD --query value | sed 's/"//g' >> ${{github.workspace}}/PGPASSWORD + az keyvault secret show --vault-name bpfperformacesecrets --name PGPORT --query value | sed 's/"//g' >> ${{github.workspace}}/PGPORT + + - name: Test POSTGRES access + run: | + export PGPASSWORD=$(cat ${{github.workspace}}/PGPASSWORD) + export PGHOST=$(cat ${{github.workspace}}/PGHOST) + export PGUSER=$(cat ${{github.workspace}}/PGUSER) + export PGPORT=$(cat ${{github.workspace}}/PGPORT) + export PGDATABASE=$(cat ${{github.workspace}}/PGDATABASE) + psql -c "SELECT * FROM BenchmarkResults LIMIT 50" + +