Skip to content

added browser site to device and app management #382

added browser site to device and app management

added browser site to device and app management #382

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.gitignore'
- '.editorconfig'
- 'docs/**'
- '.github/ISSUE_TEMPLATE/**'
- 'examples/**'
- 'website/**'
- '.vscode/**'
- '.idea/**'
- '**/*.txt'
- '**/*.png'
- '**/*.jpg'
- '**/*.svg'
- '.golangci.yml'
- 'Makefile'
- 'scripts/**'
- '.dockerignore'
- 'Dockerfile'
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: 'go.mod'
cache: true
go-version: stable
- run: go mod download
- name: Build provider
run: |
go build -o terraform-provider-microsoft365
mkdir -p ${{ github.workspace }}/bin
mv terraform-provider-microsoft365 ${{ github.workspace }}/bin/
- name: Upload provider binary
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: terraform-provider-microsoft365
path: ${{ github.workspace }}/bin/terraform-provider-microsoft365
test:
name: Terraform Provider Acceptance Tests
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
terraform:
- '1.7.*'
- '1.8.*'
- '1.9.*'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
cache: true
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Download provider binary
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: terraform-provider-microsoft365
path: ${{ github.workspace }}/bin
- name: Check for provider binary
run: |
if [ ! -f "${{ github.workspace }}/bin/terraform-provider-microsoft365" ]; then
echo "Provider binary not found. Exiting."
exit 1
fi
- name: Make provider binary executable
run: chmod +x ${{ github.workspace }}/bin/terraform-provider-microsoft365
- name: Go mod download
run: go mod download
- name: Debug Environment Variables
run: |
echo "M365_TENANT_ID: $M365_TENANT_ID"
echo "M365_AUTH_METHOD: $M365_AUTH_METHOD"
echo "M365_CLIENT_ID: $M365_CLIENT_ID"
echo "M365_USE_PROXY: $M365_USE_PROXY"
echo "M365_CLOUD: $M365_CLOUD"
env:
M365_TENANT_ID: ${{ vars.TESTS_M365_TENANT_ID }}
M365_AUTH_METHOD: ${{ vars.TESTS_M365_AUTH_METHOD }}
M365_CLIENT_ID: ${{ vars.TESTS_M365_CLIENT_ID }}
M365_USE_PROXY: ${{ vars.TESTS_M365_USE_PROXY }}
M365_CLOUD: ${{ vars.TESTS_M365_CLOUD }}
- name: Setup Provider
run: |
mkdir -p ~/.terraform.d/plugins
cp ${{ github.workspace }}/bin/terraform-provider-microsoft365 ~/.terraform.d/plugins/
- name: Initialize Terraform
run: terraform init
- name: Run Acceptance Tests
env:
# TF_ACC: "1" # TODO enable acceptance tests
M365_TENANT_ID: ${{ vars.TESTS_M365_TENANT_ID }}
M365_AUTH_METHOD: ${{ vars.TESTS_M365_AUTH_METHOD }}
M365_CLIENT_ID: ${{ vars.TESTS_M365_CLIENT_ID }}
M365_CLIENT_SECRET: ${{ vars.TESTS_M365_CLIENT_SECRET }}
M365_CLIENT_CERTIFICATE_FILE_PATH: ${{ vars.TESTS_M365_CLIENT_CERTIFICATE_FILE_PATH }}
M365_CLIENT_CERTIFICATE_PASSWORD: ${{ vars.TESTS_M365_CLIENT_CERTIFICATE_PASSWORD }}
M365_USERNAME: ${{ vars.TESTS_M365_USERNAME }}
M365_PASSWORD: ${{ vars.TESTS_M365_PASSWORD }}
M365_REDIRECT_URL: ${{ vars.TESTS_M365_REDIRECT_URL }}
M365_USE_PROXY: ${{ vars.TESTS_M365_USE_PROXY }}
M365_PROXY_URL: ${{ vars.TESTS_M365_PROXY_URL }}
M365_CLOUD: ${{ vars.TESTS_M365_CLOUD }}
M365_ENABLE_CHAOS: ${{ vars.TESTS_M365_ENABLE_CHAOS }}
M365_TELEMETRY_OPTOUT: ${{ vars.TESTS_M365_TELEMETRY_OPTOUT }}
M365_DEBUG_MODE: ${{ vars.TESTS_M365_DEBUG_MODE }}
run: |
go test -v -cover -race ./... -timeout 30m