Skip to content

Commit

Permalink
Add initial CI tests
Browse files Browse the repository at this point in the history
- Add github action workflow that runs CI tests against all PRs and
  merges to main
- Initial CI tests require that `inv pre-push` as well as `terraform
  fmt` pass
- As soon as `terraform validate` passes, the commented out checks
  should be also enabled

Signed-off-by: Henri Rosten <henri.rosten@unikie.com>
  • Loading branch information
henrirosten committed Nov 2, 2023
1 parent 9f37ac9 commit e568f38
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test-ghaf-infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: 2023 Technology Innovation Institute (TII)
#
# SPDX-License-Identifier: Apache-2.0

name: Test ghaf-infra

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- name: Run ghaf-infra CI tests
run: nix develop --command inv pre-push
- name: Run terraform fmt
run: |
TF_LOG="DEBUG" bash -c 'nix develop .#terraform --command terraform -chdir=terraform fmt'
TF_LOG="DEBUG" bash -c 'nix develop .#terraform --command terraform -chdir=terraform/azure-storage fmt'
# TODO: Enable the below check when 'terraform validate' passes:
# - name: Run terraform validate
# run: |
# TF_LOG="DEBUG" bash -c 'nix develop .#terraform --command terraform -chdir=terraform validate'
# TF_LOG="DEBUG" bash -c 'nix develop .#terraform --command terraform -chdir=terraform/azure-storage validate'

0 comments on commit e568f38

Please sign in to comment.