-
Notifications
You must be signed in to change notification settings - Fork 12
Basic Windows and Linux CI workflows #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3d42c5c
4261179
6a32f3e
43e8284
b66c73f
828e680
1c552e1
91a7a61
3f510b1
056f08a
48a5570
088498d
abf78af
563afc9
40ea2d0
4da117f
104d566
c5cab1b
72910bb
5ed298f
4e63f1e
50ccf40
74a4936
85869e9
d3d740f
488a629
67d37db
5cf2d3d
353a3c8
87882a1
9c158ab
a622fe6
b82bcc4
3ed08da
a105c07
2ab9284
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: CLI container-less on Linux | ||
|
|
||
| inputs: | ||
| tag: | ||
| description: | | ||
| Tag release | ||
| required: false | ||
| type: string | ||
| default: latest | ||
| tier: | ||
| description: | | ||
| Test TIER name | ||
| required: false | ||
| type: string | ||
| default: TIER0 | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'microsoft' | ||
| java-version: '21' | ||
| - run: java --version | ||
| shell: bash | ||
| - name: Set up Igor's kantra installer | ||
| shell: bash | ||
| run: | | ||
| git clone https://github.com/ibragins/konveyor-cli-deployment.git | ||
| cd konveyor-cli-deployment | ||
| pip install -r requirements.txt | ||
| echo '{"misc_downstream_path": "","temp_dir": "","extract_binary": "","get_images_output": "","bundle": "","no_brew": "","ssh_user": "","ssh_key": ""}' >> config.json | ||
| # Workaround ruleset home (?) | ||
| mkdir -p /home/runner/.config | ||
| ./install_cli.py --upstream true | ||
| cd .. | ||
| chmod +x /home/runner/.kantra/kantra | ||
| /home/runner/.kantra/kantra --help | ||
|
|
||
| - name: Configure Test Environment Variables | ||
| shell: bash | ||
| run: | | ||
| cp .env.example .env | ||
| mkdir ${{ github.workspace }}/report | ||
|
|
||
| > .env | ||
| echo "KANTRA_CLI_PATH=/home/runner/.kantra/kantra" >> .env | ||
| echo "REPORT_OUTPUT_PATH=${{ github.workspace }}/report" >> .env | ||
| echo "PROJECT_PATH=${{ github.workspace }}" >> .env | ||
|
|
||
| cat .env | ||
| # Set test tier to ENV variable (could be changed) | ||
| export ${{ inputs.tier }}=1 | ||
| working-directory: ${{ github.workspace }} | ||
| - name: Install test dependencies | ||
| shell: bash | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| # TODO: Run test for TIER0 | ||
| - name: Run simple standard analysis test | ||
| shell: bash | ||
| run: | | ||
| pytest -s -k "jee_example_app and not bug" | ||
|
|
||
| - name: Save analysis output | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kantra-outputs | ||
| path: ${{ github.workspace }}/report | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: CLI containes on Linux | ||
|
|
||
| inputs: | ||
| tag: | ||
| description: | | ||
| Tag release | ||
| required: false | ||
| type: string | ||
| default: latest | ||
| tier: | ||
| description: | | ||
| Test TIER name | ||
| required: false | ||
| type: string | ||
| default: TIER0 | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Homebrew | ||
| uses: Homebrew/actions/setup-homebrew@master | ||
| - name: Upgrade podman # TODO: little strange, copied from kantra demo testing workflow. | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get install -y ansible | ||
| export DEB=$(curl -s https://passt.top/builds/latest/x86_64/ | grep deb | awk -F '"' '{ print $4}') | ||
| sudo ansible -m apt -a deb=https://passt.top/builds/latest/x86_64/${DEB} localhost | ||
| sudo apt-get remove podman crun | ||
| brew install crun podman | ||
| - run: podman --help | ||
| shell: bash | ||
| - name: Set up Igor's kantra installer | ||
| shell: bash | ||
| run: | | ||
| git clone https://github.com/ibragins/konveyor-cli-deployment.git | ||
| cd konveyor-cli-deployment | ||
| pip install -r requirements.txt | ||
| echo '{"misc_downstream_path": "","temp_dir": "","extract_binary": "","get_images_output": "","bundle": "","no_brew": "","ssh_user": "","ssh_key": ""}' >> config.json | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least empty values are needed with current version of |
||
| # Workaround ruleset home (?) | ||
| mkdir -p /home/runner/.config | ||
| ./install_cli.py --upstream true | ||
| cd .. | ||
| chmod +x /home/runner/.kantra/kantra | ||
| /home/runner/.kantra/kantra --help | ||
|
|
||
| - name: Configure Test Environment Variables | ||
| shell: bash | ||
| run: | | ||
| cp .env.example .env | ||
| mkdir ${{ github.workspace }}/report | ||
|
|
||
| > .env | ||
| echo "KANTRA_CLI_PATH=/home/runner/.kantra/kantra" >> .env | ||
| echo "REPORT_OUTPUT_PATH=${{ github.workspace }}/report" >> .env | ||
| echo "PROJECT_PATH=${{ github.workspace }}" >> .env | ||
|
|
||
| cat .env | ||
| # Set test tier to ENV variable (could be changed) | ||
| export ${{ inputs.tier }}=1 | ||
|
|
||
| # Temporary dirty workaround to execute container kantra (with run-local=false) | ||
| sed -i 's/ analyze / analyze --run-local=false /g' utils/command.py | ||
| working-directory: ${{ github.workspace }} | ||
| - name: Install test dependencies | ||
| shell: bash | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
|
|
||
| # TODO: Run test for TIER0 | ||
| - name: Run simple standard analysis test | ||
| shell: bash | ||
| run: | | ||
| pytest -s -k "jee_example_app and not bug" | ||
|
|
||
| - name: Save analysis output | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kantra-outputs | ||
| path: ${{ github.workspace }}/report | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: CLI container-less on Windows | ||
|
|
||
| inputs: | ||
| tag: | ||
| description: | | ||
| Tag release | ||
| required: false | ||
| type: string | ||
| default: latest | ||
| tier: | ||
| description: | | ||
| Test TIER name | ||
| required: false | ||
| type: string | ||
| default: TIER0 | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'microsoft' | ||
| java-version: '21' | ||
| - run: java --version | ||
| shell: cmd | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' | ||
| - run: python -m pip install --upgrade pip | ||
| shell: cmd | ||
| - name: Set up Igor's kantra installer | ||
| shell: cmd | ||
| run: | | ||
| git clone https://github.com/ibragins/konveyor-cli-deployment.git | ||
| cd konveyor-cli-deployment | ||
| pip install -r requirements.txt | ||
| REM Error parsing json, trying just dummy example file, might be OK for upstream | ||
| cp config.json.example config.json | ||
| REM TODO: Use ${{ inputs.tag }} to specify required kantra version | ||
| python install_cli.py --upstream true | ||
| C:\Users\runneradmin\.kantra\windows-kantra.exe --help | ||
|
|
||
| - name: Configure Test Environment Variables | ||
| shell: cmd | ||
| run: | | ||
| cp .env.example .env | ||
|
|
||
| echo "KANTRA_CLI_PATH=C:\Users\runneradmin\.kantra\windows-kantra.exe" >> .env | ||
| echo "REPORT_OUTPUT_PATH=${{ github.workspace }}\report" >> .env | ||
| echo "PROJECT_PATH=${{ github.workspace }}" >> .env | ||
| REM # Set test tier to ENV variable (could be changed) | ||
| set ${{ inputs.tier }}=1 | ||
| working-directory: ${{ github.workspace }} | ||
| - name: Install test dependencies | ||
| shell: cmd | ||
| run: | | ||
| pip install -r requirements.txt | ||
| mkdir ${{ github.workspace }}\report | ||
|
|
||
| # TODO: Run test for TIER0 | ||
| - name: Run simple standard analysis test | ||
| shell: cmd | ||
| run: | | ||
| pytest -s -k "jee_example_app and not bug" | ||
|
|
||
| - name: Save analysis output | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kantra-outputs | ||
| path: ${{ github.workspace }}\report |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Nightly CLI test for main | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '08 1,13 * * *' | ||
|
|
||
| jobs: | ||
| test-suite: | ||
| uses: aufi/kantra-cli-tests/.github/workflows/test-suite.yaml@basic-workflows # Replace with konveyor-ecosystem (cannot do checkout before for different OSs) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will replace |
||
| with: | ||
| tag: latest | ||
| tier: TIER0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: PR/push CLI tests for main | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '**.md' | ||
| push: | ||
| branches: [ "main" ] | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| test-suite: | ||
| uses: aufi/kantra-cli-tests/.github/workflows/test-suite.yaml@basic-workflows # Replace with konveyor-ecosystem (cannot do checkout before for different OSs) | ||
| with: | ||
| tag: latest | ||
| tier: TIER0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: CLI test suite | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| tag: | ||
| description: | | ||
| Tag release | ||
| required: false | ||
| type: string | ||
| default: latest | ||
| tier: | ||
| description: | | ||
| Test TIER name | ||
| required: false | ||
| type: string | ||
| default: TIER0 | ||
|
|
||
| jobs: | ||
| tests-windows-containerless: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Windows container-less tests | ||
| uses: ./.github/actions/tests-windows-containerless | ||
| with: | ||
| tag: ${{ inputs.tag }} | ||
| tier: ${{ inputs.tier }} | ||
|
|
||
| tests-linux-containerless: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Linux container-less tests | ||
| uses: ./.github/actions/tests-linux-containerless | ||
| with: | ||
| tag: ${{ inputs.tag }} | ||
| tier: ${{ inputs.tier }} | ||
|
|
||
|
|
||
| tests-linux-containers: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Linux containers tests | ||
| uses: ./.github/actions/tests-linux-containers | ||
| with: | ||
| tag: ${{ inputs.tag }} | ||
| tier: ${{ inputs.tier }} |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .env file also need to configure the followin properties for analysis test on private repos:
GIT_USERNAMEGIT_PASSWORDThis can be configured in a follow-up PR as the test that you're running right now is not using these properties.
Edit: I see the ci failures, I believe those can be addressed in next prs but we can merge this initial work, wdyt @ibragins ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abrugaro git credentials are required for some tests only, CI purpose is to run BASIC tests, so actually those parameters can stay blanked.
Regarding failures - I would like to solve them before merging if failures are related to the changes that this PR brings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for feedback!