From 12544517fdc24ca1fefbaf1a6158c86b72566534 Mon Sep 17 00:00:00 2001 From: Corey Osman Date: Wed, 20 Apr 2022 13:35:19 -0700 Subject: [PATCH] Adds basic workflow for pdk based modules --- .github/workflows/pdk-basic.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/pdk-basic.yml diff --git a/.github/workflows/pdk-basic.yml b/.github/workflows/pdk-basic.yml new file mode 100644 index 0000000..d0bcf06 --- /dev/null +++ b/.github/workflows/pdk-basic.yml @@ -0,0 +1,52 @@ +# This is a basic workflow to help you get started with Actions + +name: PDK basic + +# Controls when the workflow will run +on: + workflow_call: + inputs: + container_image: + description: Image to use when running tests + default: 'puppet/puppet-dev-tools:2022-03-28-92c7176' + required: false + type: string + + +env: + GITHUB_USER: ${{ secrets.PUPPET_REPO_USER }} + GITHUB_TOKEN: ${{ secrets.PUPPET_REPO_USER_TOKEN }} + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + validate: + # The type of runner that the job will run on + runs-on: ubuntu-latest + strategy: + matrix: + puppet-version: [5, 6, 7] + container: ${{ inputs.container_image }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: action-pdk-validate-puppet-${{ matrix.puppet-version }} + run: pdk validate --puppet-version=${{ matrix.puppet-version }} + # Runs pdk test unit + + unit-puppet: + runs-on: ubuntu-latest + strategy: + matrix: + puppet-version: [5, 6, 7] + container: ${{ inputs.container_image }} + needs: validate + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v2 + + - name: action-pdk-test-unit-puppet-${{ matrix.puppet-version }} + run: pdk test unit --puppet-version=${{ matrix.puppet-version }}