Revert "CI: Move apply tests to central workflow" #197
Workflow file for this run
This file contains hidden or 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: Tests | |
| on: | |
| pull_request: {} | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| rubocop_and_matrix: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| ruby: ${{ steps.ruby.outputs.versions }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Ruby ${{ matrix.ruby }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - name: Run Rubocop | |
| run: bundle exec rake rubocop | |
| - id: ruby | |
| uses: voxpupuli/ruby-version@v1 | |
| cache_modules: | |
| runs-on: ubuntu-24.04 | |
| name: 'Run r10k and update module cache' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Ruby ${{ matrix.ruby }} | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: "3.4" | |
| bundler-cache: true | |
| - name: Cache modules | |
| id: modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: modules | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }} | |
| - name: Install modules | |
| if: steps.modules.outputs.cache-hit != 'true' | |
| run: bundle exec r10k puppetfile install | |
| unit: | |
| needs: | |
| - rubocop_and_matrix | |
| - cache_modules | |
| name: "Unit tests ${{ matrix.ruby }} ${{ matrix.os }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, windows-2025] | |
| ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Output Ruby Environment | |
| run: bundle env | |
| - name: Cache modules | |
| id: modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: modules | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }} | |
| - name: Unit tests | |
| run: bundle exec rake tests:unit | |
| run-dita: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Initialize | |
| uses: actions/checkout@v5 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.3 | |
| bundler-cache: true | |
| - name: Generate docs | |
| run: bundle exec rake docs:all | |
| - name: Docs test | |
| uses: dita-ot/dita-ot-action@4.1.2 | |
| with: | |
| build: dita -i documentation/bolt.ditamap -o out -f html5 --processing-mode=strict | |
| local_transports: | |
| name: "local transport ${{ matrix.ruby }} ${{ matrix.os }}" | |
| needs: | |
| - rubocop_and_matrix | |
| - cache_modules | |
| env: | |
| BOLT_WINRM_USER: roddypiper | |
| BOLT_WINRM_HOST: localhost | |
| BOLT_WINRM_PORT: 5985 | |
| BOLT_WINRM_SSL_PORT: 5986 | |
| BOLT_WINRM_SMB_PORT: 445 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04, windows-2025] | |
| ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Cache modules | |
| id: modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: modules | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }} | |
| - if: matrix.os == 'ubuntu-24.04' | |
| uses: ./.github/actions/sudo_setup | |
| - if: matrix.os == 'windows-2025' | |
| uses: ./.github/actions/windows_agent_setup | |
| - if: matrix.os == 'ubuntu-24.04' | |
| name: Run tests | |
| run: bundle exec rake ci:local_transport:linux | |
| - if: matrix.os == 'windows-2025' | |
| name: Run tests | |
| run: bundle exec rake ci:local_transport:windows | |
| winrm_transport: | |
| needs: | |
| - rubocop_and_matrix | |
| - cache_modules | |
| env: | |
| BOLT_WINRM_USER: roddypiper | |
| BOLT_WINRM_HOST: localhost | |
| BOLT_WINRM_PORT: 5985 | |
| BOLT_WINRM_SSL_PORT: 5986 | |
| BOLT_WINRM_SMB_PORT: 445 | |
| name: WinRM Transport | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby }} | |
| bundler-cache: true | |
| - name: Cache modules | |
| id: modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: modules | |
| key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }} | |
| - name: Configure WinRM and use Puppet's Ruby | |
| shell: powershell | |
| run: | | |
| . scripts\ci.ps1 | |
| Set-ActiveRubyFromPuppet | |
| - name: WinRM transport tests | |
| run: bundle exec rake ci:winrm_transport | |
| tests: | |
| needs: | |
| - rubocop_and_matrix | |
| - cache_modules | |
| - unit | |
| - run-dita | |
| - local_transports | |
| - winrm_transport | |
| runs-on: ubuntu-24.04 | |
| name: Test suite | |
| steps: | |
| - run: echo Test suite complete |