Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adds a TF testing workflow + changes renovate schedule #18

Merged
merged 6 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/tf-test.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions tests/main.tftest.hcl
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading