Skip to content

Commit

Permalink
Add ghaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
liangyuanpeng committed May 3, 2024
1 parent f1d6323 commit 27ffc57
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: kind-build-node
on:
push:

jobs:

kind-build-node:
name: build-kind
permissions:
packages: write
runs-on: ubuntu-22.04
steps:
- name: checkoutactions
uses: actions/checkout@v4

- uses: oras-project/setup-oras@v1
with:
version: 1.0.0

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: build kind
run: |
wget -q https://github.com/kubernetes-sigs/kind/releases/download/v0.22.0/kind-linux-amd64
chmod +x kind-linux-amd64 && mv kind-linux-amd64 /usr/local/bin/kind
# Free up disk space on Ubuntu
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed, if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
swap-storage: false

- name: build kind node
id: build-kind-node
run: |
IMGTAG=`git describe --tags`
mkdir -p tmp
cd tmp
kind build node-image --image ghcr.io/$GITHUB_REPOSITORY_OWNER/kindest/testnode:$KIND_VERSION-$IMGTAG --kube-root $PWD/../
67 changes: 67 additions & 0 deletions .github/workflows/conformance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: conformance
on:
push:

jobs:

conformance-kind-ga-only-parallel:
name: conformance-kind-ga-only-parallel
strategy:
max-parallel: 6
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-latest
runs-on: ${{ matrix.os }}
env:
GA_ONLY: true
PARALLEL: true
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: run
run: |
curl -sSL https://kind.sigs.k8s.io/dl/latest/linux-amd64.tgz | tar xvfz - -C "${PATH%%:*}/" && e2e-k8s.sh
- name: check artifacts
if: always()
run: |
ls _artifacts
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if: always()
with:
name: conformance_kind_ga_only_parallel_${{ matrix.os }}
path: _artifacts
76 changes: 76 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: unit
on:
push:

jobs:

unit:
name: unit
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 6
fail-fast: false
matrix:
goversion:
- "go.mod"
- "1.22.1"
os:
- ubuntu-22.04
- ubuntu-latest
steps:
- uses: actions/setup-go@v5
if: matrix.goversion != 'go.mod'
with:
go-version: ${{ matrix.goversion }}
- uses: oras-project/setup-oras@v1
with:
version: 1.0.0
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: checkoutactions
uses: actions/checkout@v4
- uses: actions/setup-go@v5
if: matrix.goversion == 'go.mod'
with:
go-version-file: go.mod
- name: run
run: |
make test
- name: check artifacts
if: always()
run: |
mkdir -p _artifacts
ls _artifacts
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
if: always()
with:
name: unit
path: _artifacts

0 comments on commit 27ffc57

Please sign in to comment.