Allow to set the version of the unittest plugin #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: {} | |
push: | |
branches: [ master ] | |
jobs: | |
test-action-simple: | |
name: Single Chart | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check that Helm is installed | |
run: command -v helm >/dev/null 2>/dev/null | |
- name: Check that helm-unittest is installed | |
run: helm plugin list | sed 1d | awk '{print $1}' | grep -q '^unittest$' | |
- name: Check that tests were run on example chart | |
run: test -d example-chart/tests/__snapshot__ | |
test-action-multiple-charts: | |
name: Multiple Charts | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Copy example chart to multiple places | |
run: | | |
mv example-chart example-chart-1 | |
cp -r example-chart-1 example-chart-2 | |
mkdir -p somedir/subdir | |
cp -r example-chart-1 somedir/subdir/inner-chart | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check that tests were run on all charts | |
run: | | |
for chart in example-chart-{1,2} somedir/subdir/inner-chart; do | |
test -d "$chart"/tests/__snapshot__ | |
done | |
test-action-charts-param: | |
name: Charts By Param | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Copy example chart to multiple places | |
run: | | |
mv example-chart example-chart-1 | |
cp -r example-chart-1 example-chart-2 | |
mkdir -p somedir/subdir | |
cp -r example-chart-1 somedir/subdir/inner-chart | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
charts: example-chart-2 | |
- name: Check that tests were run on only specified chart | |
run: | | |
test -d example-chart-2/tests/__snapshot__ | |
! test -d example-chart-1/tests/__snapshot__ | |
! test -d somedir/subdir/inner-chart/tests/__snapshot__ | |
test-action-force-install: | |
name: Force Install | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Try running composite action in force install mode | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
install-mode: force | |
test-action-if-not-present: | |
name: If Not Present | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Try running composite action in if-not-present mode | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
install-mode: if-not-present | |
test-action-unittest-version: | |
name: Unittest Version | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
unittest-version: v0.3.4 | |
- name: Check that helm-unittest is installed | |
run: helm plugin list | sed 1d | awk '{print $1}' | grep -q '^unittest$' | |
- name: Check that helm-unittest version is v0.3.4 | |
run: helm plugin list | awk '/^unittest\s/ { found = 1; print $2 } END { exit !found }' | grep -q '^0.3.4$' | |
test-action-simple-install: | |
name: Simple Install | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository files | |
uses: actions/checkout@v3 | |
- name: Run composite action | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Try running composite action in simple install mode | |
uses: ./ | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
continue-on-error: true | |
id: secondinstall | |
- if: steps.secondinstall.outcome != 'success' | |
run: echo "Composite action failed to install plugin as expected!" | |
- if: steps.secondinstall.outcome == 'success' | |
run: | | |
echo "Composite action installed plugin successfully, which is unexpected!" | |
exit 1 |