Skip to content

update gh action

update gh action #101

Workflow file for this run

# .github/workflows/build-test.yml
name: Build and Test Java 17 with Maven
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Create Kind Cluster
uses: helm/[email protected]
- name: Test with Maven
run: |
kubectl cluster-info --context kind-chart-testing
mvn -B compile --file ./resilience-bench/operator/pom.xml
find ./resilience-bench/operator/target/classes/META-INF/fabric8 -type f -name "*-v1.yml" | xargs -I {} kubectl apply -f {}
kubectl get crd
mvn -B test --file ./resilience-bench/operator/pom.xml
# Log in to GitHub Container Registry
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image
- name: Build and push Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}/resilience-bench:${{ github.sha }} .
docker push ghcr.io/${{ github.repository }}/resilience-bench:${{ github.sha }}