diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 805b082..a485de5 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -3,7 +3,8 @@ "config:recommended", "github>aquaproj/aqua-renovate-config#2.6.0" ], - "schedule": ["before 5am on Monday"], + // Schedule once a month on the first day of the month before 4 AM. + "schedule": ["* 0-3 1 * *"], "baseBranches": ["main", "master"], "labels": ["auto-upgrade"], "dependencyDashboardAutoclose": true, diff --git a/.github/workflows/tf-test.yaml b/.github/workflows/tf-test.yaml new file mode 100644 index 0000000..59802e1 --- /dev/null +++ b/.github/workflows/tf-test.yaml @@ -0,0 +1,49 @@ +name: TF Test + +on: + push: + branches: + - main + pull_request: + +env: + SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} + SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }} + +permissions: + actions: read + checks: write + contents: read + id-token: write + pull-requests: read + +jobs: + tf-test: + name: ${{ matrix.tf }} Test + runs-on: ubuntu-latest + strategy: + matrix: + tf: [tofu, terraform] + steps: + - uses: actions/checkout@v4 + + - name: Aqua Cache + uses: actions/cache@v4.0.2 + if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing + with: + path: ~/.local/share/aquaproj-aqua + key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}} + restore-keys: | + v1-aqua-installer-${{runner.os}}-${{runner.arch}}- + + - name: Install Aqua + uses: aquaproj/aqua-installer@4551ec64e21bf0f557c2525135ff0bd2cba40ec7 # v3.0.0 + with: + aqua_version: v2.25.2 + + - name: Aqua Install + shell: bash + run: aqua install --tags ${{ matrix.tf }} + + - run: ${{ matrix.tf }} init + - run: ${{ matrix.tf }} test diff --git a/aqua.yaml b/aqua.yaml index c82feb9..51a518f 100644 --- a/aqua.yaml +++ b/aqua.yaml @@ -12,5 +12,7 @@ registries: packages: - name: terraform-docs/terraform-docs@v0.19.0 - name: hashicorp/terraform@v1.10.3 + tags: [terraform] - name: opentofu/opentofu@v1.8.7 + tags: [tofu] - name: spacelift-io/spacectl@v1.8.0 diff --git a/tests/main.tftest.hcl b/tests/main.tftest.hcl index 2a899e6..b821d27 100644 --- a/tests/main.tftest.hcl +++ b/tests/main.tftest.hcl @@ -1,3 +1,7 @@ +provider "spacelift" { + api_key_endpoint = "https://masterpointio.app.spacelift.io" +} + variables { root_modules_path = "./tests/fixtures" common_config_file = "common.yaml"