|
| 1 | +# `name` value will appear "as is" in the badge. |
| 2 | +# See https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#adding-a-workflow-status-badge-to-your-repository |
| 3 | +name: "build" |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - master |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - '**' |
| 12 | + |
| 13 | +jobs: |
| 14 | + bin: |
| 15 | + name: "Build `getenvoy` and `e2e` binaries for use in e2e tests" |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: "Checkout" |
| 19 | + uses: actions/checkout@v2 |
| 20 | + |
| 21 | + - name: "Install Go" |
| 22 | + uses: actions/setup-go@v2 |
| 23 | + with: |
| 24 | + go-version: '1.13.3' |
| 25 | + |
| 26 | + - name: "Init on first use" |
| 27 | + run: make init |
| 28 | + |
| 29 | + - name: "Build `getenvoy` and `e2e` binaries" |
| 30 | + run: make bin |
| 31 | + |
| 32 | + - name: "Share `getenvoy` and `e2e` binaries with the downstream jobs" |
| 33 | + uses: actions/upload-artifact@v2 |
| 34 | + with: |
| 35 | + name: bin |
| 36 | + path: build/bin |
| 37 | + |
| 38 | + e2e_linux: |
| 39 | + name: "Run e2e tests on Linux" |
| 40 | + needs: |
| 41 | + - bin |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - name: "Checkout" |
| 45 | + uses: actions/checkout@v2 |
| 46 | + |
| 47 | + - name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job" |
| 48 | + uses: actions/download-artifact@v2 |
| 49 | + with: |
| 50 | + name: bin |
| 51 | + path: build/bin |
| 52 | + |
| 53 | + - name: "Build language-specific Docker build images" |
| 54 | + run: make builders |
| 55 | + |
| 56 | + - name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job" |
| 57 | + env: |
| 58 | + # Allow extension templates to have dependecies on private GitHub repositories. |
| 59 | + E2E_ALLOW_PRIVATE_DEPENDENCIES: 'yes' |
| 60 | + # Key of a GitHub "machine user" that has access to all private repositories needed by e2e tests: |
| 61 | + # user: https://github.com/getenvoy-ci |
| 62 | + # key fingeprint: MD5:ae:8d:18:6a:1b:44:17:dc:b8:c8:0f:a9:48:44:be:2b |
| 63 | + # |
| 64 | + # See https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users |
| 65 | + E2E_GITHUB_MACHINE_USER_KEY: ${{ secrets.E2E_GITHUB_MACHINE_USER_KEY }} |
| 66 | + run: ./ci/e2e/linux/run_tests.sh |
| 67 | + |
| 68 | + e2e_macos: |
| 69 | + name: "Run e2e tests on MacOS" |
| 70 | + needs: |
| 71 | + - bin |
| 72 | + runs-on: macos-latest |
| 73 | + steps: |
| 74 | + - name: "Checkout" |
| 75 | + uses: actions/checkout@v2 |
| 76 | + |
| 77 | + - name: "Re-use `getenvoy` and `e2e` binaries pre-built by the upstream job" |
| 78 | + uses: actions/download-artifact@v2 |
| 79 | + with: |
| 80 | + name: bin |
| 81 | + path: build/bin |
| 82 | + |
| 83 | + - name: "Install 'Docker for Mac' (an older version that can be installed in CI environment)" |
| 84 | + run: ./ci/e2e/macos/install_docker.sh |
| 85 | + |
| 86 | + - name: "Build language-specific Docker build images" |
| 87 | + env: |
| 88 | + # don't use `DOCKER_BUILDKIT=1`, `--build-arg BUILDKIT_INLINE_CACHE=1` and `--cache-from` |
| 89 | + # options when using `Docker for Mac` in CI environment |
| 90 | + USE_DOCKER_BUILDKIT_CACHE: 'no' |
| 91 | + run: make builders |
| 92 | + |
| 93 | + - name: "Run e2e tests using `getenvoy` and `e2e` binaries built by the upstream job" |
| 94 | + env: |
| 95 | + # Allow extension templates to have dependecies on private GitHub repositories. |
| 96 | + E2E_ALLOW_PRIVATE_DEPENDENCIES: 'yes' |
| 97 | + # Key of a GitHub "machine user" that has access to all private repositories needed by e2e tests: |
| 98 | + # user: https://github.com/getenvoy-ci |
| 99 | + # key fingeprint: MD5:ae:8d:18:6a:1b:44:17:dc:b8:c8:0f:a9:48:44:be:2b |
| 100 | + # |
| 101 | + # See https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users |
| 102 | + E2E_GITHUB_MACHINE_USER_KEY: ${{ secrets.E2E_GITHUB_MACHINE_USER_KEY }} |
| 103 | + run: ./ci/e2e/macos/run_tests.sh |
0 commit comments