diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 6708e64627..3792b8d8b2 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -10,6 +10,7 @@ includePaths: [ 'docs/**', '.github/', + 'release/**', ], enabledManagers: [ 'regex', @@ -27,6 +28,7 @@ 'github.com/earthly/earthly:(?.+?)(\\+|`)', '(:|\\s+)earthly/earthly:(?.+?)[\\s\\n/]+', 'the `latest` tag is `(?.+?)`', + 'earthly/compare/(?.+?)\\.\\.\\.main', ], depNameTemplate: 'earthly/earthly', datasourceTemplate: 'github-releases', diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000000..e9365d9b06 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1 @@ +dsfdsfdsf diff --git a/.github/workflows/build-earthly.yml b/.github/workflows/build-earthly.yml deleted file mode 100644 index ff0b17376a..0000000000 --- a/.github/workflows/build-earthly.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Earthly Build - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - -jobs: - - build-earthly: - name: build (and push) earthly using ${{inputs.BINARY}} - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # Used in our github action as the token - TODO: look to change it into an input - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: earthly/actions-setup@main - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: remove Docker - run: ${{inputs.SUDO}} apt-get purge docker-engine docker docker.io docker-ce docker-ce-cli ; ${{inputs.SUDO}} rm -rf /usr/bin/docker - if: inputs.BINARY != 'docker' - - name: Install Podman (with apt-get) - run: ${{inputs.SUDO}} apt-get update && ${{inputs.SUDO}} apt-get install -y podman && ${{inputs.SUDO}} rm -f /etc/containers/registries.conf - if: inputs.binary == 'podman' - - name: Podman debug info - run: podman version && podman info && podman info --debug - if: inputs.BINARY == 'podman' - - name: Docker mirror login (Earthly Only) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Earthly bootstrap - run: ${{inputs.SUDO}} $(which earthly) bootstrap - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ${{inputs.SUDO}} $(which earthly) config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Docker Login - run: ${{inputs.SUDO}} ${{inputs.BINARY}} login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - if: inputs.BINARY == 'docker' - - name: Podman Login - run: ${{inputs.SUDO}} ${{inputs.BINARY}} login docker.io --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - if: inputs.BINARY == 'podman' - - name: Build latest earthly using released earthly - run: ${{inputs.SUDO}} $(which earthly) --use-inline-cache +for-linux - - name: Earthly bootstrap using latest earthly build - run: ${{inputs.SUDO}} ./build/linux/amd64/earthly bootstrap - - 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: Build and push +ci-release using latest earthly build - run: ${{inputs.SUDO}} ./build/linux/amd64/earthly --ci --push +ci-release --TAG_SUFFIX="${{inputs.RUNS_ON}}-${{inputs.BINARY}}" - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd - if: ${{ failure() }} diff --git a/.github/workflows/ci-docker-satellites.yml b/.github/workflows/ci-docker-satellites.yml deleted file mode 100644 index ce2f67a3db..0000000000 --- a/.github/workflows/ci-docker-satellites.yml +++ /dev/null @@ -1,180 +0,0 @@ -name: Satellites Docker CI Ubuntu - -on: - push: - branches: [ main ] - paths-ignore: [ docs/** ] - pull_request: - branches: [ main ] - paths-ignore: [ docs/** ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-earthly: - uses: ./.github/workflows/build-earthly.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-lint: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+lint-all" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-no-qemu-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-no-qemu-normal: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-normal" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-no-qemu-slow: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-slow" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-require-account-access: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "./tests+tests-that-require-earthly-technologies-account-access" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-tests-qemu: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-qemu" - USE_QEMU: true - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-satellites-examples-1: - needs: build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXAMPLE_NAME: "+examples1" - USE_SATELLITE: true - SATELLITE_NAME: "core-examples" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-satellites-examples-2: - needs: build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXAMPLE_NAME: "+examples2" - USE_SATELLITE: true - SATELLITE_NAME: "core-examples" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-satellites-test-local: - needs: build-earthly - uses: ./.github/workflows/reusable-test-local.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUN_EARTHLY_TEST_ARGS: "--no-output" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - BINARY_COMPOSE: "\"docker compose\"" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - - docker-build-with-satellites: - needs: build-earthly - uses: ./.github/workflows/reusable-docker-build-integrations.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - USE_SATELLITE: true - SATELLITE_NAME: "core-test" - EARTHLY_ORG: "earthly-technologies" - secrets: inherit - diff --git a/.github/workflows/ci-docker-ubuntu.yml b/.github/workflows/ci-docker-ubuntu.yml deleted file mode 100644 index 60e02c2007..0000000000 --- a/.github/workflows/ci-docker-ubuntu.yml +++ /dev/null @@ -1,707 +0,0 @@ -name: Docker CI Ubuntu - -on: - push: - branches: [ main ] - paths-ignore: [ docs/** ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-earthly: - uses: ./.github/workflows/build-earthly.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-lint: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+lint-all" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-no-qemu-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-no-qemu-quick-no-logbus: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXTRA_ARGS: "--logstream=false --logstream-upload=false" - secrets: inherit - - docker-tests-no-qemu-normal: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-normal" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-no-qemu-normal-no-logbus: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-normal" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXTRA_ARGS: "--logstream=false --logstream-upload=false" - secrets: inherit - - docker-tests-no-qemu-slow: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-slow" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-no-qemu-kind: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-kind" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-require-account-access: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "./tests+tests-that-require-earthly-technologies-account-access" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-tests-qemu: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-qemu" - USE_QEMU: true - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-examples-1: - needs: build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXAMPLE_NAME: "+examples1" - secrets: inherit - - docker-examples-2: - needs: build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - EXAMPLE_NAME: "+examples2" - secrets: inherit - - docker-test-local: - needs: build-earthly - uses: ./.github/workflows/reusable-test-local.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - BINARY_COMPOSE: "\"docker compose\"" - SUDO: "" - secrets: inherit - - docker-push-integrations: - needs: build-earthly - uses: ./.github/workflows/reusable-push-integrations.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-secret-integrations: - needs: build-earthly - uses: ./.github/workflows/reusable-secrets-integrations.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-bootstrap-integrations: - needs: build-earthly - uses: ./.github/workflows/reusable-bootstrap-integrations.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-repo-auth-tests: - needs: build-earthly - uses: ./.github/workflows/reusable-repo-auth-tests.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-export-test: - needs: build-earthly - uses: ./.github/workflows/reusable-export-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-docker-build-integrations: - needs: build-earthly - uses: ./.github/workflows/reusable-docker-build-integrations.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-earthly-image-test: - needs: build-earthly - uses: ./.github/workflows/reusable-earthly-image-tests.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-misc-test-1: - needs: build-earthly - uses: ./.github/workflows/reusable-misc-tests-1.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-misc-test-2: - needs: build-earthly - uses: ./.github/workflows/reusable-misc-tests-2.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-wait-block-override: - needs: build-earthly - uses: ./.github/workflows/reusable-wait-block-override.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - docker-git-metadata-test: - needs: build-earthly - uses: ./.github/workflows/reusable-git-metadata-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - race-tests-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-race-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - TEST_TARGET: "+test-quick" - RUNS_ON: "ubuntu-latest" - USE_QEMU: false - BINARY: "docker" - SUDO: "" - secrets: inherit - - race-tests-no-qemu-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-race-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - TEST_TARGET: "+test-no-qemu-quick" - RUNS_ON: "ubuntu-latest" - USE_QEMU: false - BINARY: "docker" - SUDO: "" - secrets: inherit - - race-tests-no-qemu-normal: - needs: build-earthly - uses: ./.github/workflows/reusable-race-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - TEST_TARGET: "+test-no-qemu-normal" - RUNS_ON: "ubuntu-latest" - USE_QEMU: false - BINARY: "docker" - SUDO: "" - secrets: inherit - - race-tests-no-qemu-slow: - needs: build-earthly - uses: ./.github/workflows/reusable-race-test.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - TEST_TARGET: "+test-no-qemu-slow" - RUNS_ON: "ubuntu-latest" - USE_QEMU: false - BINARY: "docker" - SUDO: "" - secrets: inherit - - tutorial: - needs: build-earthly - name: Tutorial - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Build latest earthly using released earthly - run: ./build/earthly --use-inline-cache +for-linux - - 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: Build tutorial part 1 - run: ./build/earthly -P ./examples/tutorial+test-part1 --earthly=$(realpath ./build/earthly) - - name: Build tutorial part 2 - run: ./build/earthly -P ./examples/tutorial+test-part2 --earthly=$(realpath ./build/earthly) - - name: Build tutorial part 3 - run: ./build/earthly -P ./examples/tutorial+test-part3 --earthly=$(realpath ./build/earthly) - - name: Build tutorial part 4 - run: ./build/earthly -P ./examples/tutorial+test-part4 --earthly=$(realpath ./build/earthly) - - name: Build tutorial part 5 - run: ./build/earthly -P ./examples/tutorial+test-part5 --earthly=$(realpath ./build/earthly) - - name: Build tutorial part 6 - run: ./build/earthly -P ./examples/tutorial+test-part6 --earthly=$(realpath ./build/earthly) - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - buildkitd-amd64: - needs: build-earthly - name: +all-buildkitd-amd64 - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - 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: Build linux/amd64 +buildkitd - run: |- - ./build/earthly --ci --platform=linux/amd64 ./buildkitd+buildkitd --BUILDKIT_PROJECT="$BUILDKIT_PROJECT" - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - buildkitd-arm64: - needs: build-earthly - name: +all-buildkitd-arm64 - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - 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: Build linux/arm64 +buildkitd - run: |- - ./build/earthly --ci --platform=linux/arm64 ./buildkitd+buildkitd --BUILDKIT_PROJECT="$BUILDKIT_PROJECT" - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - all-dind: - needs: build-earthly - name: +all-dind - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - 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: Build +all-dind - run: ./build/earthly --ci +all-dind - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - earthly: - needs: build-earthly - name: +earthly-all +earthly-docker - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - 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: Build +earthly-all - run: ./build/earthly --ci +earthly-all - - name: Build +earthly-docker - run: ./build/earthly --ci +earthly-docker - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - prerelease: - needs: build-earthly - name: +prerelease - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - 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: Build +prerelease - run: ./build/earthly --ci +prerelease - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} - - push-prerelease: - name: --push +prerelease - if: github.event_name == 'push' - needs: - - build-earthly - - buildkitd-amd64 - - buildkitd-arm64 - - prerelease - - earthly - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - name: "Put back the git branch into git (Earthly uses it for tagging)" - run: | - branch="" - if [ -n "$GITHUB_HEAD_REF" ]; then - branch="$GITHUB_HEAD_REF" - else - branch="${GITHUB_REF##*/}" - fi - git checkout -b "$branch" || true - - name: Docker mirror login (Earthly Only) - run: docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/earthly - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - ./build/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Docker Login (main build) - run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - - 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: Build and push +prerelease - run: ./build/earthly --ci --push +prerelease - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd - if: ${{ failure() }} diff --git a/.github/workflows/ci-lint-docs.yml b/.github/workflows/ci-lint-docs.yml deleted file mode 100644 index 6530c4c9c6..0000000000 --- a/.github/workflows/ci-lint-docs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: lint-docs - -on: - push: - branches: [ main, next ] - pull_request: - branches: [ main, next ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - name: +lint-docs - runs-on: "ubuntu-latest" - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: earthly/actions-setup@main - - name: Execute lint - run: earthly --ci -P +lint-docs diff --git a/.github/workflows/ci-podman-ubuntu.yml b/.github/workflows/ci-podman-ubuntu.yml deleted file mode 100644 index fd2138bd43..0000000000 --- a/.github/workflows/ci-podman-ubuntu.yml +++ /dev/null @@ -1,238 +0,0 @@ -name: Podman CI Ubuntu - -on: - push: - branches: [ main ] - paths-ignore: [ docs/** ] - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - build-earthly: - uses: ./.github/workflows/build-earthly.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-lint: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+lint-all" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-no-qemu-quick: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-quick" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-no-qemu-normal: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-normal" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-no-qemu-slow: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-no-qemu-slow" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-require-account-access: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "./tests+tests-that-require-earthly-technologies-account-access" - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-tests-qemu: - needs: build-earthly - uses: ./.github/workflows/reusable-test.yml - with: - TEST_TARGET: "+test-qemu" - USE_QEMU: true - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - SUDO: "sudo -E" - secrets: inherit - - podman-examples-1: - # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd - needs: - - build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - USE_QEMU: true - SUDO: "sudo -E" - EXAMPLE_NAME: "+examples1" - secrets: inherit - - podman-examples-2: - # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd - needs: - - build-earthly - uses: ./.github/workflows/reusable-example.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "podman" - USE_QEMU: true - SUDO: "sudo -E" - EXAMPLE_NAME: "+examples2" - secrets: inherit - -# podman-test-local: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-test-local.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# BINARY_COMPOSE: "\"sudo -E podman-compose\"" -# SUDO: "sudo -E" -# secrets: inherit -# -# TODO: Fix and bring back the below tests -# podman-push-integrations: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: build-earthly -# uses: ./.github/workflows/reusable-push-integrations.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-secret-integrations: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-secrets-integrations.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-bootstrap-integrations: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-bootstrap-integrations.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-repo-auth-tests: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-repo-auth-tests.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-export-tests: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-export-test.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-earthly-image-tests: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-earthly-image-tests.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-misc-tests-1: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-misc-tests-1.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit -# -# podman-misc-tests-2: -# # TODO: Figure out how to run multiple Podman instances in parallel with different ports for buildkitd -# needs: -# - build-earthly -# uses: ./.github/workflows/reusable-misc-tests-2.yml -# with: -# BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" -# RUNS_ON: "ubuntu-latest" -# BINARY: "podman" -# SUDO: "sudo -E" -# secrets: inherit diff --git a/.github/workflows/ci-scheduled-codeql-analysis.yml b/.github/workflows/ci-scheduled-codeql-analysis.yml deleted file mode 100644 index fd2f7a9633..0000000000 --- a/.github/workflows/ci-scheduled-codeql-analysis.yml +++ /dev/null @@ -1,78 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '28 18 * * 0' - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/ci-scheduled-pkg-tests.yml b/.github/workflows/ci-scheduled-pkg-tests.yml deleted file mode 100644 index 3a30f3b302..0000000000 --- a/.github/workflows/ci-scheduled-pkg-tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: "test apt and yum repos" -on: - schedule: - - cron: "0 0 * * *" # once a day - push: - branches: - - '**-cron-test' -jobs: - apt: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Docker Login (main build) - run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - - name: test apt repo - run: cat CHANGELOG.md | grep '## v[0-9]\+.[0-9]\+.[0-9]\+' | awk '{print $2}' | head -n 1 > expected-version && test -n "$(cat expected-version)" - - name: test apt repo - run: docker run --rm ubuntu /bin/sh -c 'export DEBIAN_FRONTEND=noninteractive && apt-get update -y && apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release && curl -fsSL https://pkg.earthly.dev/earthly.pgp | gpg --dearmor -o /usr/share/keyrings/earthly-archive-keyring.gpg && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/earthly-archive-keyring.gpg] https://pkg.earthly.dev/deb stable main" > /etc/apt/sources.list.d/earthly.list && apt-get update -y && apt-get install -y earthly && earthly --version' | tee apt.log && tail -n 1 apt.log | grep "earthly version $(cat expected-version)" - yum: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Docker Login (main build) - run: docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - - name: test apt repo - run: cat CHANGELOG.md | grep '## v[0-9]\+.[0-9]\+.[0-9]\+' | awk '{print $2}' | head -n 1 > expected-version && test -n "$(cat expected-version)" - - name: test yum repo - run: docker run --rm fedora /bin/sh -c 'dnf -y install dnf-plugins-core && dnf config-manager --add-repo https://pkg.earthly.dev/earthly.repo && dnf install -y earthly && earthly --version' | tee yum.log && tail -n 1 yum.log | grep "earthly version $(cat expected-version)" diff --git a/.github/workflows/ci-scheduled-podman-mac.yml b/.github/workflows/ci-scheduled-podman-mac.yml deleted file mode 100644 index 3ae5a7dbce..0000000000 --- a/.github/workflows/ci-scheduled-podman-mac.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Podman Mac CI - -on: - schedule: - - cron: '0 6 * * * ' # Every day at 6:00AM UTC (~midnight CST pending DST) - -jobs: - tests: - name: +testing-gha-podman - runs-on: macos-12 # GitHub Actions the latest tag still uses macos-11, which does not have brew installed by default - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - BUILT_EARTHLY_PATH: build/darwin/amd64/earthly - 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 }} - - # matches hardware specs of macos-12 self-hosted machine - # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources - PODMAN_CPUS: 3 - PODMAN_MEMORY_MB: 13000 - PODMAN_DISK_SPACE_GB: 13 - steps: - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - uses: earthly/actions-setup@main - - name: Install podman - run: brew install podman - - name: Podman Mac Helper - # the $(ls /usr/local/Cellar/podman) fills in the version number - run: sudo /usr/local/Cellar/podman/$(ls /usr/local/Cellar/podman)/bin/podman-mac-helper install \ - && echo "DOCKER_HOST=unix:///Users/runner/.local/share/containers/podman/machine/podman-machine-default/podman.sock" >> $GITHUB_ENV - - name: Init and start podman machine - run: podman machine init --now --cpus ${{ env.PODMAN_CPUS }} --disk-size ${{ env.PODMAN_DISK_SPACE_GB }} --memory ${{ env.PODMAN_MEMORY_MB }} --rootful=true - - name: Podman machine ls - run: podman machine ls - - name: Podman machine inspect - run: podman machine inspect podman-machine-default - - name: Podman info - run: podman info - - name: Podman info debug - run: podman info --debug - - name: Podman version - run: podman version - - name: Virtualization check - run: sysctl -a | grep machdep.cpu.features - - name: Docker mirror login via Podman (Earthly Only) - run: podman login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Configure Earthly to use mirror (Earthly Only) - run: |- - earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Bootstrap Earthly using released earthly - run: earthly bootstrap - - name: Build latest earthly using released earthly - run: earthly -P --use-inline-cache +for-darwin - - name: Re-bootstrap Earthly using latest earthly build - run: ${{ env.BUILT_EARTHLY_PATH }} bootstrap - - name: rebuild earthly using latest earthly build - run: ${{ env.BUILT_EARTHLY_PATH }} -P --use-inline-cache +for-darwin - - 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" - # Note - we only run the non-qemu tests here because we have not figured out cross-compilation on Mac using Podman yet - - name: Execute tests-no-qemu - run: ${{env.BUILT_EARTHLY_PATH}} --ci -P +test-no-qemu - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Execute fail test - run: "! ${{ env.BUILT_EARTHLY_PATH }} --ci ./tests/fail+test-fail" - - name: Buildkit logs (runs on failure) - run: podman logs earthly-buildkitd - if: ${{ failure() }} diff --git a/.github/workflows/ci-staging-deploy.yml b/.github/workflows/ci-staging-deploy.yml deleted file mode 100644 index d3af4575d9..0000000000 --- a/.github/workflows/ci-staging-deploy.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: staging release - -on: - push: - branches: - - 'main' - - '**-staging-test' - paths-ignore: - - 'docs/**' - -jobs: - build-earthly: - uses: ./.github/workflows/build-earthly.yml - with: - BUILT_EARTHLY_PATH: "./build/linux/amd64/earthly" - RUNS_ON: "ubuntu-latest" - BINARY: "docker" - SUDO: "" - secrets: inherit - - tests: - name: staging release - needs: build-earthly - runs-on: ubuntu-latest - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - GITHUB_USER: "earthly" - EARTHLY_REPO: "earthly-staging" - BREW_REPO: "homebrew-earthly-staging" - DOCKERHUB_USER: "earthly" - DOCKERHUB_IMG: "earthly-staging" - DOCKERHUB_BUILDKIT_IMG: "buildkitd-staging" - # Used in our github action as the token - TODO: look to change it into an input - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 - - name: Configure earthly accounts (Earthly Only) - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - run: |- - docker login --username "${{ secrets.DOCKERHUB_USERNAME }}" --password "${{ secrets.DOCKERHUB_TOKEN }}" - docker login registry-1.docker.io.mirror.corp.earthly.dev --username "${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" --password "${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" - - - name: Retrieve earthly from build-earthly job - run: |- - BUILDKITD_IMAGE=docker.io/earthly/buildkitd-staging TAG=${GITHUB_SHA}-ubuntu-latest-docker ./earthly upgrade - mkdir -p $(dirname "./build/linux/amd64/earthly") - mv ${HOME}/.earthly/earthly-${GITHUB_SHA}-ubuntu-latest-docker ./build/linux/amd64/earthly - - name: Configure Earthly to use mirror (Earthly Only) - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - run: |- - ./build/linux/amd64/earthly config global.buildkit_additional_config "'[registry.\"docker.io\"] - - mirrors = [\"registry-1.docker.io.mirror.corp.earthly.dev\"]'" - - name: staging releases - run: |- - set -euo pipefail - export SHA_DEC="$(echo "ibase=16; $(git rev-parse --short HEAD | tr '[:lower:]' '[:upper:]')" | bc)" - export RELEASE_TAG="v0.$(date +%s).$SHA_DEC" - export SKIP_CHANGELOG_DATE_TEST=true - export S3_BUCKET="staging-pkg" - export earthly="./build/linux/amd64/earthly" - echo "attempting staging-release version: $RELEASE_TAG" - eval "$(ssh-agent -s)" - "$earthly" secrets --org earthly-technologies --project core get -n littleredcorvette-id_rsa | ssh-add - - git remote add staging git@github.com:earthly/earthly-staging.git - git push staging HEAD:pre-release-$RELEASE_TAG - echo -e "# Earthly Changelog\n\nAll notable changes to [Earthly](https://github.com/earthly/earthly) will be documented in this file.\n\n## Unreleased\n\n## $RELEASE_TAG - $(date +%Y-%m-%d)\n\nThis pre-release was built from $(git rev-parse HEAD)" > CHANGELOG.md - ./release/release.sh - - name: Buildkit logs (runs on failure) - if: ${{ failure() }} - run: docker logs earthly-buildkitd diff --git a/.github/workflows/lint-docs.yaml b/.github/workflows/lint-docs.yaml new file mode 100644 index 0000000000..460e968624 --- /dev/null +++ b/.github/workflows/lint-docs.yaml @@ -0,0 +1,54 @@ +name: CI workflow + +on: + push: + branches: [ main ] + pull_request_target: + branches: [ main ] + pull_request: + branches: [ main ] + check_run: + types: [completed] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + print1: + if: ${{ github.event_name == 'check_run' }} + runs-on: ubuntu-latest + steps: + - name: test1 + run: echo hello world ${{ github.event_name }} + ido: + name: ido test + needs: print1 + if: ${{ failure() && (github.event_name == 'pull_request_target' || github.event.pull_request.head.repo.full_name == 'ido123') }} + uses: ./.github/workflows/reusable_test.yaml + with: + VAL1: ${{ github.ref != 'refs/heads/main' }} + VAL2: ${{ github.ref == 'refs/heads/main' }} + VAL3: --BRANCH=${{ github.head_ref }} + changes: + #1 + if: ${{ github.event_name == 'pull_request' }} + uses: ./.github/workflows/reuseable-find-pr-changes.yaml + permissions: + pull-requests: read + secrets: inherit + build-earthly: + needs: changes + if: ${{ !failure() }} + name: build earthly + uses: ./.github/workflows/reusable-lint.yaml + with: + SKIP_JOB: ${{ needs.changes.outputs.essential-file == 'false' }} + test2: + needs: build-earthly + #if: ${{ !failure() && (needs.build-earthly.result == 'success' || needs.build-earthly.result == 'skipped') }} + if: ${{ !failure() }} + name: docker test + uses: ./.github/workflows/reusable-lint.yaml + with: + SKIP_JOB: ${{ needs.build-earthly.result != 'success' }} diff --git a/.github/workflows/pr_target.yml b/.github/workflows/pr_target.yml new file mode 100644 index 0000000000..3c6fd28836 --- /dev/null +++ b/.github/workflows/pr_target.yml @@ -0,0 +1,29 @@ +name: create pr for fork + +on: + pull_request_target: + types: [ labeled ] + branches: [ "main" ] + +jobs: + create-pr: + if: ${{ github.event.label.name == 'approved-for-tests' }} + runs-on: "ubuntu-latest" + env: + FORCE_COLOR: 1 + EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" + EARTHLY_ORG: "ido+test" + EARTHLY_INSTALL_ID: "earthly-githubactions" + # Used in our github action as the token - TODO: look to change it into an input + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.number }} + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: earthly/actions-setup@main + - name: list secrets + run: earthly secrets ls + - name: run earthly + run: earthly --ci +open-pr-for-fork --pr_number=${{ github.actor }} + diff --git a/.github/workflows/reusable-bootstrap-integrations.yml b/.github/workflows/reusable-bootstrap-integrations.yml deleted file mode 100644 index f5a0ed41e5..0000000000 --- a/.github/workflows/reusable-bootstrap-integrations.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Bootstrap Integrations - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - -jobs: - secret-integration: - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - 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 }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ${{inputs.RUNS_ON}} - steps: - - uses: actions/checkout@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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 bootstrap-integration - run: frontend=${{inputs.BINARY}} default_install_name=earthly ./tests/bootstrap/test-bootstrap.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-docker-build-integrations.yml b/.github/workflows/reusable-docker-build-integrations.yml deleted file mode 100644 index c90bc19561..0000000000 --- a/.github/workflows/reusable-docker-build-integrations.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: docker-build Integrations - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - type: string - required: false - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - EARTHLY_ORG: - required: false - type: string - -jobs: - docker-build-integration: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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 docker-build-integration - run: ${{inputs.SUDO}} env earthly=${{inputs.BUILT_EARTHLY_PATH}} scripts/tests/docker-build/integration.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} docker logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-earthly-image-tests.yml b/.github/workflows/reusable-earthly-image-tests.yml deleted file mode 100644 index 832fae6d74..0000000000 --- a/.github/workflows/reusable-earthly-image-tests.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Earthly Image Tests - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - - -jobs: - earthly-image-tests: - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Build the earthly docker image - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} +earthly-docker --TAG=image-test - - name: "Run the earthly image tests" - run: FRONTEND=${{inputs.BINARY}} EARTHLY_IMAGE=earthly/earthly:image-test DOCKERHUB_MIRROR_USERNAME="${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" DOCKERHUB_MIRROR_PASSWORD="${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_PASSWORD="${{ secrets.DOCKERHUB_PASSWORD }}" ./scripts/tests/earthly-image.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd - if: ${{ failure() && ! inputs.USE_SATELLITE }} - earthly-image-sat-tests: - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Build the earthly docker image - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} +earthly-docker --TAG=image-test - - name: "Run the earthly image sat tests" - run: FRONTEND=${{inputs.BINARY}} EARTHLY_IMAGE=earthly/earthly:image-test DOCKERHUB_MIRROR_USERNAME="${{ secrets.DOCKERHUB_MIRROR_USERNAME }}" DOCKERHUB_MIRROR_PASSWORD="${{ secrets.DOCKERHUB_MIRROR_PASSWORD }}" DOCKERHUB_USERNAME="${{ secrets.DOCKERHUB_USERNAME }}" DOCKERHUB_PASSWORD="${{ secrets.DOCKERHUB_PASSWORD }}" ./scripts/tests/earthly-image-sat.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-example.yml b/.github/workflows/reusable-example.yml deleted file mode 100644 index 2b10af24a1..0000000000 --- a/.github/workflows/reusable-example.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Runs examples1 - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_QEMU: - required: false - type: boolean - EXAMPLE_NAME: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - EARTHLY_ORG: - required: false - type: string - - -jobs: - example: - name: ${{inputs.EXAMPLE_NAME}}-${{inputs.RUNS_ON}}-${{inputs.BINARY}} - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - USE_QEMU: "${{ inputs.USE_QEMU }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Link Earthly dir to Earthly dev dir - run: mkdir -p ~/.earthly && ln -s ~/.earthly ~/.earthly-dev - - name: Build ${{inputs.EXAMPLE_NAME}} (PR build) - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P ${{inputs.EXAMPLE_NAME}} - if: github.event_name != 'push' - - name: Build ${{inputs.EXAMPLE_NAME}} (main build) - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci --push -P ${{inputs.EXAMPLE_NAME}} - if: github.event_name == 'push' - - name: Build and test multi-platform example - run: | - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} ./examples/multiplatform+all - ${{inputs.SUDO}} ${{inputs.BINARY}} run --rm earthly/examples:multiplatform_linux_arm64 | grep aarch64 - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-export-test.yml b/.github/workflows/reusable-export-test.yml deleted file mode 100644 index 7c51a518ef..0000000000 --- a/.github/workflows/reusable-export-test.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Repo Auth Tests - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - -jobs: - export-test: - name: Export tests - runs-on: ${{inputs.RUNS_ON}} - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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 export tests - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} frontend=${{inputs.BINARY}} scripts/tests/export.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-git-metadata-test.yml b/.github/workflows/reusable-git-metadata-test.yml deleted file mode 100644 index d95204ed79..0000000000 --- a/.github/workflows/reusable-git-metadata-test.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Test Earthly - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - EARTHLY_ORG: - required: false - type: string - - -jobs: - test: - name: +testing-gha-${{inputs.RUNS_ON}}-${{inputs.BINARY}} - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Execute git-metadata-test - run: |- - ${{inputs.SUDO}} ${{ inputs.BUILT_EARTHLY_PATH }} --ci -P \ - ./tests/git-metadata+test - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-lint.yaml b/.github/workflows/reusable-lint.yaml new file mode 100644 index 0000000000..c2441cc0b5 --- /dev/null +++ b/.github/workflows/reusable-lint.yaml @@ -0,0 +1,19 @@ +name: reuseable-lint + +on: + workflow_call: + inputs: + SKIP_JOB: + required: true + type: boolean + +jobs: + lint-this: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: earthly/actions-setup@main + - name: Execute lint + run: earthly --ci -P --platform linux/arm64 +lint-docs diff --git a/.github/workflows/reusable-misc-tests-1.yml b/.github/workflows/reusable-misc-tests-1.yml deleted file mode 100644 index 311b39b2c0..0000000000 --- a/.github/workflows/reusable-misc-tests-1.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Misc Tests 1 - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - - -jobs: - misc-tests-1: - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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 parallel buildkit start test. It ensures that earthly starting up buildkit does not race with itself. - run: |- - ${{inputs.SUDO}} ${{inputs.BINARY}} stop earthly-buildkitd || true && \ - for i in 1 2 3 4; do - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} github.com/earthly/hello-world+hello & \ - pids[${i}]=$! - done && \ - for pid in ${pids[*]}; do - wait $pid - done - - name: "Run the earthly satellites tests (Earthly only)" # TODO Move to seperate earthly-only workflow file - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} ./scripts/tests/satellites-integration.sh - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Execute interactive debugger test - run: ./scripts/tests/interactive-debugger/test-interactive.py --earthly ${{inputs.BUILT_EARTHLY_PATH}} --timeout 180 - - name: "cloud-stored docker credential test (Earthly only)" # TODO Move to seperate earthly-only workflow file - run: FRONTEND=${{inputs.BINARY}} earthly=${{inputs.BUILT_EARTHLY_PATH}} ./scripts/tests/cloud-docker-credentials-integration.sh - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Execute version test - run: "${{inputs.BUILT_EARTHLY_PATH}} --version" - - name: Execute docker2earth test - run: "./tests/docker2earth/test.sh" - - name: Execute remote-cache test - run: frontend=${{inputs.BINARY}} ./tests/remote-cache/test.sh - - name: Execute registry-certs test - run: frontend=${{inputs.BINARY}} ./tests/registry-certs/test.sh - - name: Execute try-catch test - run: ./tests/try-catch/test.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-misc-tests-2.yml b/.github/workflows/reusable-misc-tests-2.yml deleted file mode 100644 index 6614cefa23..0000000000 --- a/.github/workflows/reusable-misc-tests-2.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Misc Tests 2 - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - - -jobs: - misc-tests-2: - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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 linux-amd64 specific tests - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P ./tests+ga-linux-amd64 - - name: Execute tests requiring .git directory - run: go test ./analytics --tags=hasgitdirectory - - name: Execute earthly ${{inputs.BINARY}} command - run: (cd tests/docker && ${{inputs.SUDO}} ../../${{inputs.BUILT_EARTHLY_PATH}} docker-build --tag examples-test-docker:latest . && diff <(docker run --rm examples-test-docker:latest) <(echo "hello dockerfile") ) - - name: Execute private image test (Earthly Only) # TODO move to separate workflow - run: ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci ./tests+private-image-test - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - - name: Execute save images test - run: frontend=${{inputs.BINARY}} ./tests/save-images/test.sh - - name: Experimental tests - run: |- - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P ./tests+experimental - - name: Test buildkit info-level logging - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd 2>&1 | grep 'running server on' - - name: Test for uncommitted generated code - run: |- - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P ./ast/parser+test-not-committed - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-push-integrations.yml b/.github/workflows/reusable-push-integrations.yml deleted file mode 100644 index 158c4f2682..0000000000 --- a/.github/workflows/reusable-push-integrations.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Push Integrations - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - - -jobs: - push-integrations: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Push and Pull Cloud Images - run: |- - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P \ - ./tests/cloud-push-pull+all - - name: Push Images after RUN --push - run: ${{inputs.SUDO}} frontend=${{inputs.BINARY}} ./tests/push-images/test.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-race-test.yml b/.github/workflows/reusable-race-test.yml deleted file mode 100644 index 86f84e6148..0000000000 --- a/.github/workflows/reusable-race-test.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Test Earthly (-race) - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - TEST_TARGET: - required: true - type: string - RUNS_ON: - required: true - type: string - USE_QEMU: - required: false - type: boolean - -jobs: - test-race: - name: ${{inputs.TEST_TARGET}} (-race) - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Build latest earthly/buildkitd image using released earthly - run: ${{ inputs.BUILT_EARTHLY_PATH }} --use-inline-cache ./buildkitd+buildkitd --TAG=race-test - - name: Execute tests - run: |- - GORACE="halt_on_error=1" go run -race ./cmd/earthly/*.go --buildkit-image earthly/buildkitd:race-test -P --no-output \ - ${{inputs.TEST_TARGET}} - - name: Buildkit logs (runs on failure) - run: docker logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-repo-auth-tests.yml b/.github/workflows/reusable-repo-auth-tests.yml deleted file mode 100644 index eebcf88b01..0000000000 --- a/.github/workflows/reusable-repo-auth-tests.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Repo Auth Tests - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - -jobs: - repo-auth-test: - name: repo auth tests - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ${{inputs.RUNS_ON}} - services: - sshd: - image: rastasheep/ubuntu-sshd:18.04 - ports: - - 2222:22 - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - SSH_PORT: "2222" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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" -# to regenerate the entries below; run earthly ./scripts/tests/auth+generate-github-tasks -# auto-generated-entries start; - - name: run test-hello-world-no-ssh-agent.sh - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} scripts/tests/auth/test-hello-world-no-ssh-agent.sh - - name: run test-hello-world-no-ssh-keys.sh - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} scripts/tests/auth/test-hello-world-no-ssh-keys.sh - - name: run test-hello-world-with-non-authorized-key.sh - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} scripts/tests/auth/test-hello-world-with-non-authorized-key.sh - - name: run test-self-hosted.sh - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} frontend=${{inputs.BINARY}} scripts/tests/auth/test-self-hosted.sh -# auto-generated-entries end - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-secrets-integrations.yml b/.github/workflows/reusable-secrets-integrations.yml deleted file mode 100644 index cde4d75f4f..0000000000 --- a/.github/workflows/reusable-secrets-integrations.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Secrets Integrations - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - -jobs: - secret-integration: - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: install expect - run: sudo apt-get install -y expect - - name: run secrets-integration - run: env earthly=${{inputs.BUILT_EARTHLY_PATH}} scripts/tests/secrets-integration.sh - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() }} diff --git a/.github/workflows/reusable-test-local.yml b/.github/workflows/reusable-test-local.yml deleted file mode 100644 index b7b2f6ba05..0000000000 --- a/.github/workflows/reusable-test-local.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Runs test local - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - RUN_EARTHLY_TEST_ARGS: - required: false - type: string - default: "--use-inline-cache --save-inline-cache --no-output" - BINARY: - required: true - type: string - BINARY_COMPOSE: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - EARTHLY_ORG: - required: false - type: string - - -jobs: - test-local: - name: test-local ${{inputs.BINARY}} - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Execute test-local - run: "${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} ${{inputs.RUN_EARTHLY_TEST_ARGS}} ./tests/local+test-local --FRONTEND=${{inputs.BINARY}}" - - name: Execute test-local --push - run: "${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} ${{inputs.RUN_EARTHLY_TEST_ARGS}} --push ./tests/local+test-local --FRONTEND=${{inputs.BINARY}}" - - name: Run general local tests (TODO this is re-testing the +test-local target) - run: "${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} ${{inputs.RUN_EARTHLY_TEST_ARGS}} ./tests/local+all --FRONTEND=${{inputs.BINARY}} --FRONTEND_COMPOSE=${{inputs.BINARY_COMPOSE}}" - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-test.yml b/.github/workflows/reusable-test.yml deleted file mode 100644 index a3134343da..0000000000 --- a/.github/workflows/reusable-test.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Test Earthly - -on: - workflow_call: - inputs: - TEST_TARGET: - required: true - type: string - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - USE_QEMU: - required: false - type: boolean - USE_SATELLITE: - required: false - type: boolean - default: false - SATELLITE_NAME: - required: false - type: string - EARTHLY_ORG: - required: false - type: string - EXTRA_ARGS: - required: false - type: string - -jobs: - test: - name: +testing-gha-${{inputs.RUNS_ON}}-${{inputs.BINARY}} - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - EARTHLY_ORG: "${{inputs.EARTHLY_ORG}}" - 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - USE_QEMU: "${{ inputs.USE_QEMU }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Execute ${{ inputs.TEST_TARGET }} (Earthly Only) - run: |- - ${{inputs.SUDO}} ${{ inputs.BUILT_EARTHLY_PATH }} ${{inputs.EXTRA_ARGS}} --ci -P ${{inputs.TEST_TARGET}} - - name: Execute fail test - run: "! ${{inputs.SUDO}} ${{ inputs.BUILT_EARTHLY_PATH }} ${{inputs.EXTRA_ARGS}} --ci ./tests/fail+test-fail" - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable-wait-block-override.yml b/.github/workflows/reusable-wait-block-override.yml deleted file mode 100644 index cd8da0fc61..0000000000 --- a/.github/workflows/reusable-wait-block-override.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Wait-block-override - -on: - workflow_call: - inputs: - BUILT_EARTHLY_PATH: - required: true - type: string - BINARY: - required: true - type: string - SUDO: - type: string - required: false - RUNS_ON: - required: true - type: string - - -jobs: - wait-block-override: - runs-on: ${{inputs.RUNS_ON}} - env: - FORCE_COLOR: 1 - EARTHLY_TOKEN: "${{ secrets.EARTHLY_TOKEN }}" - EARTHLY_INSTALL_ID: "earthly-githubactions" - # 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@v3 - 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 }}" - BUILT_EARTHLY_PATH: "${{ inputs.BUILT_EARTHLY_PATH }}" - BINARY: "${{ inputs.BINARY }}" - SUDO: "${{ inputs.SUDO }}" - USE_SATELLITE: "${{ inputs.USE_SATELLITE }}" - SATELLITE_NAME: "${{ inputs.SATELLITE_NAME }}" - - 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: Execute wait-block test - run: ./tests/wait-block/test.sh - - name: Execute +test using wait-block override (Earthly Only) - run: |- - ${{inputs.SUDO}} ${{inputs.BUILT_EARTHLY_PATH}} --ci -P --global-wait-end \ - +test --GLOBAL_WAIT_END=true - - name: Buildkit logs (runs on failure) - run: ${{inputs.SUDO}} ${{inputs.BINARY}} logs earthly-buildkitd || true - if: ${{ failure() && ! inputs.USE_SATELLITE }} diff --git a/.github/workflows/reusable_test.yaml b/.github/workflows/reusable_test.yaml new file mode 100644 index 0000000000..9403c98bfe --- /dev/null +++ b/.github/workflows/reusable_test.yaml @@ -0,0 +1,24 @@ +name: reuseable-test + +on: + workflow_call: + inputs: + VAL1: + required: true + type: boolean + VAL2: + required: true + type: boolean + VAL3: + required: true + type: string + +jobs: + lint-this: + name: grand child task + runs-on: "ubuntu-latest" + steps: + - name: echo values + run: echo ${{ format('{0}',inputs.VAL1) }} && \ + echo ${{ format('{0}',inputs.VAL2) }} && \ + echo ${{inputs.VAL3}} diff --git a/.github/workflows/reuseable-find-pr-changes.yaml b/.github/workflows/reuseable-find-pr-changes.yaml new file mode 100644 index 0000000000..ca8c514a42 --- /dev/null +++ b/.github/workflows/reuseable-find-pr-changes.yaml @@ -0,0 +1,31 @@ +name: find pr file changes + +on: + workflow_call: + outputs: + essential-file: + description: A boolean (as string) indicating whether essential files were changed in the PR" + value: ${{ jobs.pr-changes.outputs.essential-file }} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + pr-changes: + runs-on: ubuntu-latest + # Set permissions to minimum required + permissions: + pull-requests: read + # Set job outputs to values from filter step + outputs: + essential-file: ${{ steps.filter.outputs.essential-file }} + steps: + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + essential-file: + # evaluate to true if at least one of the changed files is none of the following + # (separated by "|"): + - '!(docs/**/*|*.md|**/*.md|.github/renovate.json5)' diff --git a/.github/workflows/update-docker-hub-readmes.yml b/.github/workflows/update-docker-hub-readmes.yml deleted file mode 100644 index 75f6dcdd09..0000000000 --- a/.github/workflows/update-docker-hub-readmes.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Update Docker Hub READMEs - -on: - push: - branches: [ main ] - paths: [ docs/docker-images/*.md ] - -jobs: - update-docker-hub-readmes: - name: update dockerhub readmes - if: github.event_name == 'push' - runs-on: ubuntu-latest - env: - # 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@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: Update DockerHub description for earthly/earthly - uses: peter-evans/dockerhub-description@6515ba32ab40bc2d4fa334365b771770366628ff - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: earthly/earthly - readme-filepath: ./docs/docker-images/all-in-one.md - short-description: ${{ github.event.repository.description }} - - name: Update DockerHub description for earthly/buildkitd - uses: peter-evans/dockerhub-description@6515ba32ab40bc2d4fa334365b771770366628ff - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: earthly/buildkitd - readme-filepath: ./docs/docker-images/buildkit-standalone.md - short-description: Standalone Earthly buildkitd image - - name: Update DockerHub description for earthly/dind - uses: peter-evans/dockerhub-description@6515ba32ab40bc2d4fa334365b771770366628ff - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: earthly/dind - readme-filepath: ./docs/docker-images/dind.md - short-description: Standalone Earthly buildkitd image diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d93689ab95..2294b44da9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,12 +4,12 @@ Please refer to [code-of-conduct.md](./code-of-conduct.md) for details. -## Using Earthly prerelease +## Using Earthly prereleasesdf To build Earthly from source, you need the same requirements as Earthly. We recommend that you use the prerelease version of Earthly for development purposes. To launch the prerelease Earthly, simply use the `./earthly` script provided in the root of the earthly repository. The prerelease Earthly tracks the version on main. You can use `./earthly --version` to identify which Git hash was used to build it. ## Building from source - +dsf To build Earthly from source for your target system, use * Linux and WSL diff --git a/Earthfile b/Earthfile index cac160c826..4f6b44254e 100644 --- a/Earthfile +++ b/Earthfile @@ -1,5 +1,6 @@ VERSION --pass-args --no-network --arg-scope-and-set 0.7 -PROJECT earthly-technologies/core + +PROJECT ido+test/proj1 # TODO update to 3.18; however currently "podman login" (used under not-a-unit-test.sh) will error with # "Error: default OCI runtime "crun" not found: invalid argument". @@ -19,6 +20,7 @@ RUN apk add --update --no-cache \ less \ make \ openssl \ + openssh \ util-linux WORKDIR /earthly @@ -818,3 +820,27 @@ npm-update-all: RUN cd $nodepath && npm update SAVE ARTIFACT --if-exists $nodepath/package-lock.json AS LOCAL $nodepath/package-lock.json END + +# open-pr-for-fork creates a new PR based on the given pr_number +open-pr-for-fork: + #ARG git_repo="idodod/earthly" + #ARG git_url="git@github.com:$git_repo" + #ARG earthly_lib_version=2.2.2 + #DO github.com/earthly/lib/ssh:$earthly_lib_version+ADD_KNOWN_HOSTS --target_file=~/.ssh/known_hosts + #RUN git config --global user.name "littleredcorvette" && \ + # git config --global user.email "littleredcorvette@users.noreply.github.com" + #GIT CLONE "$git_url" earthly + #WORKDIR earthly + #ARG git_hash=$(git rev-parse HEAD) + #ARG TARGETARCH + ## renovate: datasource=github-releases depName=cli/cli + #ARG gh_version=v2.36.0 + #RUN curl -Lo ghlinux.tar.gz \ + # https://github.com/cli/cli/releases/download/$gh_version/gh_${gh_version#v}_linux_${TARGETARCH}.tar.gz \ + # && tar --strip-components=1 -xf ghlinux.tar.gz \ + # && rm ghlinux.tar.gz + ARG --required pr_number + RUN --no-cache echo hello from actor $pr_number + #RUN --no-cache \ + # --secret GH_TOKEN=ido-github-token \ + # ./bin/gh pr list diff --git a/docs/definitions/definitions.md b/docs/definitions/definitions.md index 960eafd100..50c47123ce 100644 --- a/docs/definitions/definitions.md +++ b/docs/definitions/definitions.md @@ -6,7 +6,7 @@ This page presents some common terms used throughout the earthly documentation. * **`earthly`** - the CLI tool used to interact with Earthly * **Earthfile** - a file (named literally `Earthfile`) which contains a series of targets and their respective recipes * **buildkitd** - a [daemon built by the Docker team](https://github.com/moby/buildkit) and used by Earthly to execute builds. It executes LLB, the same low-level primitives used when building Dockerfiles. The buildkitd daemon is started automatically in a docker container, by `earthly`, when executing builds. -* **recipe** - a specific series of build steps +* **recipe** - a specific series of build stepsdsf * **target** - the label used to identify a recipe. 'Target' is also used to refer to a build of a specific target. * **build context** - the main directory made available to the build for copying files from * **artifact** - a file resulting from executing a target (not all targets have artifacts)