Fix Workflows

This commit is contained in:
TrueCharts-Bot
2021-04-09 11:50:40 +00:00
committed by kjeld Schouten-Lebbing
parent eb9bc1ba60
commit e8414a2e8c
13 changed files with 243 additions and 680 deletions
+1 -177
View File
@@ -36,182 +36,6 @@ jobs:
run: |
/bin/bash -c "PWD=${pwd}; /usr/local/bin/catalog_validate validate --path $PWD"
common-lint:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/ct-lint.yaml --chart-dirs 'library')
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
id: lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config .github/ct-lint.yaml --chart-dirs 'library'
common-test:
runs-on: ubuntu-latest
needs: common-lint
steps:
- name: Checkout
uses: actions/checkout@v2
if: needs.common-lint.outputs.changed == 'true'
with:
fetch-depth: 0
- name: prep
if: needs.common-lint.outputs.changed == 'true'
run: |
rm -Rf library/common-test/values.yaml
touch library/common-test/values.yaml
- name: Install Helm
uses: azure/setup-helm@v1
if: needs.common-lint.outputs.changed == 'true'
with:
version: v3.5.3
- uses: actions/setup-python@v2
if: needs.common-lint.outputs.changed == 'true'
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
if: needs.common-lint.outputs.changed == 'true'
- name: Create k3d cluster
uses: nolar/setup-k3d-k3s@v1
if: needs.common-lint.outputs.changed == 'true'
with:
version: v1.19
- name: Run chart-testing (install)
if: needs.common-lint.outputs.changed == 'true'
run: ct install --config .github/ct-install.yaml --charts 'library/common-test'
common-unittest:
runs-on: ubuntu-latest
needs: common-lint
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dev tools
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: |
export RUBYJQ_USE_SYSTEM_LIBRARIES=1
bundle install
- name: Run tests
run: |
bundle exec m -r .tools/tests/charts
pre-release:
if: needs.common-lint.outputs.changed == 'true'
needs: [common-test, common-unittest, catalog-test]
runs-on: ubuntu-latest
outputs:
release: ${{ steps.prep.outputs.release }}
timeout-minutes: 5
steps:
- name: Prepare
id: prep
run: |
if [ "${{github.event_name}}" == "pull_request" ]; then
echo ::set-output name=release::false
else
echo ::set-output name=release::true
fi
- name: Block concurrent jobs
uses: softprops/turnstyle@v1
if: steps.prep.outputs.release == 'true'
with:
continue-after-seconds: 180
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
common-release:
needs: pre-release
runs-on: ubuntu-latest
if: needs.pre-release.outputs.release == 'true'
steps:
- name: Block concurrent jobs
uses: softprops/turnstyle@v1
with:
continue-after-seconds: 180
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Configure Git
run: |
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
with:
charts_dir: library
charts_repo_url: ""
config: .github/cr.yaml
env:
CR_TOKEN: "${{ secrets.BOT_TOKEN }}"
- name: Commit and Push new index
run: |
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
git add --all
git commit -sm "Commit chart-index updates" || exit 0
git push
changes:
name: Get changed Apps
runs-on: ubuntu-20.04
@@ -293,7 +117,7 @@ jobs:
run: ct install --config .github/ct-install.yaml --charts '${{ steps.prep-lint.outputs.train }}/${{ matrix.app }}'
app-tests-complete:
needs: [app-tests, common-unittest, common-test]
needs: [app-tests]
name: Apps Test Complete
runs-on: ubuntu-latest
steps:
+1 -1
View File
@@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- main
- master
paths:
- '.containers/apps/**'
- '.containers/base/**'
-2
View File
@@ -17,8 +17,6 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
# TODO remove this ref
ref: "staging"
token: ${{ secrets.BOT_TOKEN }}
fetch-depth: 1
- name: Fetch new application versions
+2
View File
@@ -22,6 +22,7 @@ on:
- './LICENSE'
- './NOTICE'
- '.github/workflows/docs.copy.yaml'
- 'index.yaml'
jobs:
copy:
@@ -43,6 +44,7 @@ jobs:
- name: Copy general readme to website
run: |
yes | cp -rf index.yaml docs/index.yaml || echo "chart-index copy failed, continuing..."
yes | cp -rf .github/README.md docs/about/index.md || echo "readme copy failed, continuing..."
yes | cp -rf .github/CODE_OF_CONDUCT docs/about/code_of_conduct.md || echo "CODE_OF_CONDUCT copy failed, continuing..."
yes | cp -rf .github/CONTRIBUTING docs/development/contributing.md || echo "CONTRIBUTING copy failed, continuing..."
+180
View File
@@ -0,0 +1,180 @@
name: "library: test & release"
on:
push:
branches:
- 'master'
tags-ignore:
- '**'
paths:
- 'library/**'
- '.github/workflows/library.release.yaml'
- '.github/cr.yaml'
pull_request:
branches:
- '**'
tags-ignore:
- '**'
paths:
- 'library/**'
- '.github/workflows/library.release.yaml'
- '.github/cr.yaml'
jobs:
common-lint:
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
- name: Run chart-testing (lint)
id: lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config .github/ct-lint.yaml --chart-dirs 'library'
common-test:
runs-on: ubuntu-latest
needs: common-lint
steps:
- name: Checkout
uses: actions/checkout@v2
if: needs.common-lint.outputs.changed == 'true'
with:
fetch-depth: 0
- name: prep
if: needs.common-lint.outputs.changed == 'true'
run: |
rm -Rf library/common-test/values.yaml
touch library/common-test/values.yaml
- name: Install Helm
uses: azure/setup-helm@v1
if: needs.common-lint.outputs.changed == 'true'
with:
version: v3.5.3
- uses: actions/setup-python@v2
if: needs.common-lint.outputs.changed == 'true'
with:
python-version: 3.7
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.0.1
if: needs.common-lint.outputs.changed == 'true'
- name: Create k3d cluster
uses: nolar/setup-k3d-k3s@v1
if: needs.common-lint.outputs.changed == 'true'
with:
version: v1.19
- name: Run chart-testing (install)
if: needs.common-lint.outputs.changed == 'true'
run: ct install --config .github/ct-install.yaml --charts 'library/common-test'
common-unittest:
runs-on: ubuntu-latest
needs: common-lint
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dev tools
run: sudo apt-get update && sudo apt-get install -y jq libjq-dev
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install dependencies
run: |
export RUBYJQ_USE_SYSTEM_LIBRARIES=1
bundle install
- name: Run tests
run: |
bundle exec m -r .tools/tests/charts
pre-release:
needs: [common-test, common-unittest]
runs-on: ubuntu-latest
outputs:
release: ${{ steps.prep.outputs.release }}
timeout-minutes: 5
steps:
- name: Prepare
id: prep
run: |
if [ "${{github.event_name}}" == "pull_request" ]; then
echo ::set-output name=release::false
else
echo ::set-output name=release::true
fi
- name: Block concurrent jobs
uses: softprops/turnstyle@v1
if: steps.prep.outputs.release == 'true'
with:
continue-after-seconds: 180
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
common-release:
needs: pre-release
runs-on: ubuntu-latest
if: needs.pre-release.outputs.release == 'true'
steps:
- name: Block concurrent jobs
uses: softprops/turnstyle@v1
with:
continue-after-seconds: 180
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Configure Git
run: |
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.3
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.2.0
with:
config: .github/cr.yaml
charts_dir: library
env:
CR_TOKEN: "${{ secrets.BOT_TOKEN }}"