Skip to content

Commit

Permalink
✨ add testing workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad committed Aug 24, 2023
1 parent e505543 commit b5df8da
Show file tree
Hide file tree
Showing 3 changed files with 2,921 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Demo Testing

on: ["push", "pull_request"]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Build image and binary
run: |
podman build -t localhost/kantra:latest -f Dockerfile .
go build -o kantra main.go
- name: Fetch sample applications
run: |
git clone https://github.com/konveyor/example-applications
git clone https://github.com/ivargrimstad/jakartaee-duke
- name: Run analysis test and copy output
run: |
RUNNER_IMG=localhost/kantra:latest ./kantra analyze --input $(pwd)/example-applications/example-1/ --output ./output/ --target cloud-readiness
- name: Fail if analysis output does not match expected
run: |
sort ./output/output.yaml > /tmp/analysis-output-actual.yaml
sort ./test-data/analysis-output.yaml > /tmp/analysis-output-expected.yaml
if diff /tmp/analysis-output-actual.yaml /tmp/analysis-output-expected.yaml > /dev/null; then
diff ./test-data/analysis-output.yaml ./output.yaml
fi
- name: Fail if dependencies output does not match expected
run: |
sort ./output/dependencies.yaml > /tmp/deps-output-actual.yaml
sort ./test-data/deps-output.yaml > /tmp/deps-output-expected.yaml
if diff /tmp/deps-output-actual.yaml /tmp/deps-output-expected.yaml > /dev/null; then
diff ./test-data/deps-output.yaml ./dependencies.yaml
fi
Loading

0 comments on commit b5df8da

Please sign in to comment.