Merge pull request #141 from crazy-max/fix-test

ci: fix standalone test
pull/142/head
CrazyMax 4 years ago committed by GitHub
commit f55bc08278
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save