Skip to content

Commit

Permalink
run-tests-on-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-benoit committed Mar 3, 2024
1 parent ba8d213 commit 771e7d1
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/run-tests-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: run-tests-on-pr
permissions:
contents: read
id-token: write
on:
pull_request:
env:
SCORE_COMPOSE_VERSION: 'latest'
SCORE_HELM_VERSION: 'latest'
WORKLOAD_NAME: hello-world
jobs:
job:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install score-compose
uses: score-spec/setup-score@v2
with:
file: score-compose
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.SCORE_COMPOSE_VERSION }}
- name: make score-compose
run: |
make score-compose
- name: make compose-up
run: |
make compose-up
- name: make compose-test
run: |
sleep 10
make compose-test
- name: create kind cluster
run: |
kind create cluster
- name: install score-helm
uses: score-spec/setup-score@v2
with:
file: score-helm
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.SCORE_HELM_VERSION }}
- name: make score-helm
run: |
make score-helm
- name: make k8s-up
id: helm-install
run: |
make k8s-up
kubectl wait \
--for=condition=available \
--timeout=30s \
deployment/${{ env.WORKLOAD_NAME }}
- name: catch helm install errors
if: ${{ failure() && steps.helm-install.outcome == 'failure' }}
run: |
kubectl get events
kubectl logs \
-l app.kubernetes.io/name=${{ env.WORKLOAD_NAME }}

0 comments on commit 771e7d1

Please sign in to comment.