Skip to content

Commit

Permalink
reusable smoke test for BYOC and self-hosted satellites
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonSc committed May 31, 2024
1 parent 1e0e0ef commit bbc5654
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci-docker-satellites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,29 @@ jobs:
SATELLITE_NAME: "core-test"
EARTHLY_ORG: "earthly-technologies"
secrets: inherit

satellites-byoc-smoke-test:
needs: build-earthly
uses: ./.github/workflows/reusable-satellite-smoke-test.yml
with:
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
RUNS_ON: "ubuntu-latest"
BINARY: "docker"
SUDO: ""
SATELLITE_NAME: "core-byoc"
EARTHLY_ORG: "earthly-technologies"
USE_VPN: true
secrets: inherit

satellites-self-hosted-smoke-test:
needs: build-earthly
uses: ./.github/workflows/reusable-satellite-smoke-test.yml
with:
BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly"
RUNS_ON: "ubuntu-latest"
BINARY: "docker"
SUDO: ""
SATELLITE_NAME: "self-hosted"
EARTHLY_ORG: "earthly-technologies"
USE_VPN: true
secrets: inherit
70 changes: 70 additions & 0 deletions .github/workflows/reusable-satellite-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Satellite Smoke Test

on:
workflow_call:
inputs:
BUILT_EARTHLY_PATH:
required: true
type: string
RUNS_ON:
required: true
type: string
SUDO:
type: string
required: false
BINARY:
required: true
type: string
SATELLITE_NAME:
required: true
type: string
EARTHLY_ORG:
required: false
type: string
USE_VPN:
required: false
type: boolean

jobs:
satellite-smoke-test:
runs-on: ${{inputs.RUNS_ON}}
env:
FORCE_COLOR: 1
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}"
EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}"
EARTHLY_SATELLITE: ${{ inputs.SATELLITE_NAME }}
EARTHLY_INSTALL_ID: "earthly-githubactions"
DOCKERHUB_MIRROR_USERNAME: "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}"
DOCKERHUB_MIRROR_PASSWORD: "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}"
# Used in our github action as the token - TODO: look to change it into an input
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/stage2-setup
with:
DOCKERHUB_MIRROR_USERNAME: "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}"
DOCKERHUB_MIRROR_PASSWORD: "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}"
DOCKERHUB_USERNAME: "${{ secrets.DOCKERHUB_USERNAME }}"
DOCKERHUB_PASSWORD: "${{ secrets.DOCKERHUB_TOKEN }}"
EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}"
BINARY: "${{ inputs.BINARY }}"
SUDO: "${{ inputs.SUDO }}"
BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}"
SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}"
USE_SATELLITE: true
- name: Configure Tailscale
uses: tailscale/github-action@v2
if: ${{ inputs.USE_VPN }}
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
tags: tag:ci
- name: Set EARTHLY_VERSION_FLAG_OVERRIDES env
run: |-
set -euo pipefail
EARTHLY_VERSION_FLAG_OVERRIDES="$(tr -d '\n' < .earthly_version_flag_overrides)"
echo "EARTHLY_VERSION_FLAG_OVERRIDES=$EARTHLY_VERSION_FLAG_OVERRIDES" >> "$GITHUB_ENV"
- name: Run satellite smoke test
run: ${{inputs.BUILT_EARTHLY_PATH}} github.com/earthly/hello-world+hello

0 comments on commit bbc5654

Please sign in to comment.