mirror of
https://github.com/bartvdbraak/keyweave.git
synced 2025-04-27 23:01:20 +00:00
101 lines
2.7 KiB
YAML
101 lines
2.7 KiB
YAML
name: Tests
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
bicep:
|
|
name: Deploy Azure resources
|
|
environment: bicep
|
|
runs-on: ubuntu-latest
|
|
concurrency:
|
|
group: bicep
|
|
env:
|
|
LOCATION: eastus
|
|
DEPLOYMENT_NAME: keyweave-${{ github.run_id }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: azure/login@v1
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Deploy Bicep template
|
|
uses: azure/arm-deploy@v1
|
|
with:
|
|
scope: subscription
|
|
region: ${{ env.LOCATION }}
|
|
template: bicep/main.bicep
|
|
deploymentName: ${{ env.DEPLOYMENT_NAME }}
|
|
|
|
tests-no-access:
|
|
name: Tests with No Access
|
|
needs: bicep
|
|
runs-on: ubuntu-latest
|
|
environment: test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: 'Az CLI login'
|
|
uses: azure/login@v1
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID_NO_ACCESS }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Run all tests
|
|
run: cargo test no_access
|
|
tests-get:
|
|
name: Tests with Get
|
|
needs: bicep
|
|
runs-on: ubuntu-latest
|
|
environment: test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: 'Az CLI login'
|
|
uses: azure/login@v1
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID_GET }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Run all tests
|
|
run: cargo test only_get
|
|
tests-list:
|
|
name: Tests with List
|
|
needs: bicep
|
|
runs-on: ubuntu-latest
|
|
environment: test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: 'Az CLI login'
|
|
uses: azure/login@v1
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID_LIST }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Run all tests
|
|
run: cargo test only_list
|
|
tests-get-list:
|
|
name: Tests with Get and List
|
|
needs: bicep
|
|
runs-on: ubuntu-latest
|
|
environment: test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- name: 'Az CLI login'
|
|
uses: azure/login@v1
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID_GET_LIST }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
- name: Run all tests
|
|
run: cargo test get_and_list_access
|