Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: split CI pull jobs #122

Merged
merged 9 commits into from
Nov 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: split CI pull jobs
wuhuizuo committed Nov 13, 2023
commit f93ed4100c610d1e163b75c2209598d5332d1d39
217 changes: 0 additions & 217 deletions .github/workflows/ci.yaml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/pull-cd-build-base-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Skaffold - test
on:
pull_request:
branches:
- main
paths:
- "dockerfiles/ci/release-build-base/**/Dockerfile"
- "dockerfiles/ci/release-build-base/**/*.Dockerfile"
- "dockerfiles/ci/skaffold.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
skaffold:
name: build images with skaffold
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

strategy:
matrix:
go-profile: [go-1.21, go-1.20, go-1.19]
builder-profile: [local-docker]
platform: [linux/amd64, linux/arm64]

steps:
- name: Checkout sources
uses: actions/checkout@v4

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup skaffold
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.8.0/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/

- name: Cache layers
uses: actions/cache@v3
with:
path: "~/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-

- name: Build images
working-directory: dockerfiles/ci
run: |
skaffold build \
--push=false \
--platform ${{ matrix.platform }} \
--module release-build-base \
--profile ${{ matrix.go-profile }},${{ matrix.builder-profile }} \
--default-repo ghcr.io/pingcap-qe/ci
69 changes: 69 additions & 0 deletions .github/workflows/pull-ci-release-utils-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Skaffold - test
on:
pull_request:
branches:
- main
paths:
- "dockerfiles/ci/release-utils/**/Dockerfile"
- "dockerfiles/ci/release-utils/**/*.Dockerfile"
- "dockerfiles/ci/skaffold.yaml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
skaffold:
name: build images with skaffold
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

strategy:
matrix:
builder-profile: [local-docker]
platform: [linux/amd64, linux/arm64]

steps:
- name: Checkout sources
uses: actions/checkout@v4

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Setup skaffold
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.8.0/skaffold-linux-amd64 && \
sudo install skaffold /usr/local/bin/

- name: Cache layers
uses: actions/cache@v3
with:
path: "~/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-

- name: Build images
working-directory: dockerfiles/ci
run: |
skaffold build \
--push=false \
--platform ${{ matrix.platform }} \
--module release-utils \
--profile ${{ matrix.builder-profile }} \
--default-repo ghcr.io/pingcap-qe/ci
Loading