|
| 1 | +name: test |
| 2 | +on: |
| 3 | + # Open a PR to update README for all PRs (as necessary) |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened] |
| 6 | + |
| 7 | +jobs: |
| 8 | + readme: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + container: cloudposse/testing.cloudposse.co:latest |
| 11 | + env: |
| 12 | + PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 13 | + MAKE_INCLUDES: Makefile |
| 14 | + steps: |
| 15 | + |
| 16 | + # Checkout the code from GitHub |
| 17 | + - name: "Checkout code" |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + # Initialize the build-harness with make target helpers |
| 21 | + - name: "Initialize build-harness" |
| 22 | + env: |
| 23 | + BUILD_HARNESS_BRANCH: master |
| 24 | + run: make init |
| 25 | + |
| 26 | + # Run the bats tests from the test-harness against the module |
| 27 | + - name: "Test that README.md was generated from README.yaml" |
| 28 | + run: make readme/lint |
| 29 | + |
| 30 | + bats: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + container: cloudposse/testing.cloudposse.co:latest |
| 33 | + env: |
| 34 | + PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 35 | + MAKE_INCLUDES: Makefile |
| 36 | + steps: |
| 37 | + |
| 38 | + # Checkout the code from GitHub |
| 39 | + - name: "Checkout code" |
| 40 | + uses: actions/checkout@v2 |
| 41 | + |
| 42 | + # Initialize the test-harness which has a library of bats tests |
| 43 | + - name: "Initialize test-harness" |
| 44 | + env: |
| 45 | + TEST_HARNESS_BRANCH: master |
| 46 | + run: make -C test/ clean init |
| 47 | + |
| 48 | + # Run the bats tests from the test-harness against the module |
| 49 | + - name: "Test module with bats" |
| 50 | + run: make -C test/ module |
| 51 | + |
| 52 | + # Run the bats tests from the test-harness against the example |
| 53 | + - name: "Test `examples/complete` with bats" |
| 54 | + run: make -C test/ examples/complete |
| 55 | + |
| 56 | + terratest: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + container: cloudposse/testing.cloudposse.co:latest |
| 59 | + env: |
| 60 | + PATH: "/usr/local/terraform/0.12/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 61 | + MAKE_INCLUDES: Makefile |
| 62 | + steps: |
| 63 | + |
| 64 | + # Checkout the code from GitHub |
| 65 | + - name: "Checkout code" |
| 66 | + uses: actions/checkout@v2 |
| 67 | + |
| 68 | + # Initialize the terratest go project |
| 69 | + - name: "Initialize terratest go project" |
| 70 | + run: make -C test/src clean init |
| 71 | + |
| 72 | + # Run the terratest integration tests |
| 73 | + - name: "Test `examples/complete` with terratest" |
| 74 | + run: make -C test/src |
| 75 | + env: |
| 76 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 77 | + AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} |
0 commit comments