Skip to content

Commit

Permalink
Merge pull request #141 from crazy-max/fix-test
Browse files Browse the repository at this point in the history
ci: fix standalone test
  • Loading branch information
crazy-max committed May 5, 2022
2 parents f211e3e + aa877a9 commit f55bc08
Showing 1 changed file with 32 additions and 52 deletions.
84 changes: 32 additions & 52 deletions .github/workflows/ci.yml
Expand Up @@ -333,14 +333,8 @@ jobs:
with:
context: .

standalone:
standalone-cmd:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
buildx-version:
- latest
- ""
steps:
-
name: Checkout
Expand All @@ -352,15 +346,18 @@ jobs:
-
name: Set up Docker Buildx
uses: ./
with:
version: ${{ matrix.buildx-version }}
-
name: Check available in path
if: matrix.standalone
name: Create Dockerfile
run: |
cat > ./Dockerfile <<EOL
FROM alpine
EOL
-
name: Build
run: |
buildx version
buildx build .
standalone-install-error:
standalone-action:
runs-on: ubuntu-latest
steps:
-
Expand All @@ -372,60 +369,43 @@ jobs:
sudo apt-get purge -y moby-cli moby-buildx
-
name: Set up Docker Buildx
id: buildx
continue-on-error: true
uses: ./
with:
install: true
version: ${{ matrix.buildx-version }}
-
name: Check
name: Create Dockerfile
run: |
echo "${{ toJson(steps.buildx) }}"
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
echo "::error::Should have failed"
exit 1
fi
cat > ./Dockerfile <<EOL
FROM alpine
EOL
-
name: Build
uses: docker/build-push-action@master
with:
context: .

standalone-kubernetes:
standalone-install-error:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Uninstall moby
run: |
sudo apt-get purge -y moby-engine moby-cli moby-buildx
-
name: Setup k8s cluster
run: |
set -x
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo swapoff -a
sudo kubeadm init --cri-socket /run/containerd/containerd.sock
mkdir -p $HOME/.kube/
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $USER $HOME/.kube/config
kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
kubectl wait --for=condition=ready --timeout=30s node --all
kubectl get nodes -o wide
-
name: Create Dockerfile
name: Uninstall docker cli
run: |
cat > ./Dockerfile <<EOL
FROM alpine
RUN echo hello
EOL
sudo apt-get purge -y moby-cli moby-buildx
-
name: Set up Docker Buildx
id: buildx
continue-on-error: true
uses: ./
with:
driver: kubernetes
install: true
-
name: Build
name: Check
run: |
buildx build .
echo "${{ toJson(steps.buildx) }}"
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
echo "::error::Should have failed"
exit 1
fi

0 comments on commit f55bc08

Please sign in to comment.