|
| 1 | +name: Test OpenTofu early eval |
| 2 | + |
| 3 | +on: |
| 4 | + - pull_request |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + |
| 9 | +jobs: |
| 10 | + s3-backend: |
| 11 | + runs-on: ubuntu-24.04 |
| 12 | + name: Plan with early eval |
| 13 | + permissions: |
| 14 | + contents: read |
| 15 | + pull-requests: write |
| 16 | + env: |
| 17 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 18 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 19 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + persist-credentials: false |
| 25 | + |
| 26 | + - name: tofu plan |
| 27 | + uses: ./tofu-plan |
| 28 | + id: plan |
| 29 | + with: |
| 30 | + path: tests/workflows/test-early-eval/s3 |
| 31 | + variables: | |
| 32 | + passphrase = "tofuqwertyuiopasdfgh" |
| 33 | +
|
| 34 | + - name: Verify outputs |
| 35 | + env: |
| 36 | + JSON_PLAN_PATH: ${{ steps.plan.outputs.json_plan_path }} |
| 37 | + run: | |
| 38 | + if [[ ! -f "$JSON_PLAN_PATH" ]]; then |
| 39 | + echo "::error:: json_plan_path not set correctly" |
| 40 | + exit 1 |
| 41 | + fi |
| 42 | +
|
| 43 | + - name: tofu apply |
| 44 | + uses: ./tofu-apply |
| 45 | + with: |
| 46 | + path: tests/workflows/test-early-eval/s3 |
| 47 | + variables: | |
| 48 | + passphrase = "tofuqwertyuiopasdfgh" |
| 49 | +
|
| 50 | + - name: Create workspace |
| 51 | + uses: ./tofu-new-workspace |
| 52 | + with: |
| 53 | + path: tests/workflows/test-early-eval/s3 |
| 54 | + workspace: test-workspace |
| 55 | + variables: | |
| 56 | + passphrase = "tofuqwertyuiopasdfgh" |
| 57 | +
|
| 58 | + - name: Create workspace again |
| 59 | + uses: ./tofu-new-workspace |
| 60 | + with: |
| 61 | + path: tests/workflows/test-early-eval/s3 |
| 62 | + workspace: test-workspace |
| 63 | + variables: | |
| 64 | + passphrase = "tofuqwertyuiopasdfgh" |
| 65 | +
|
| 66 | + - name: Destroy workspace |
| 67 | + uses: ./tofu-destroy-workspace |
| 68 | + with: |
| 69 | + path: tests/workflows/test-early-eval/s3 |
| 70 | + workspace: test-workspace |
| 71 | + variables: | |
| 72 | + passphrase = "tofuqwertyuiopasdfgh" |
0 commit comments