Test PR. Don't merge #556
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: Unit tests | |
on: | |
pull_request: | |
types: [opened, reopened, edited, synchronize] | |
paths: | |
- .github/workflows/unit.yaml | |
- bolt.gemspec | |
- Gemfile | |
- Puppetfile | |
- bolt-modules/** | |
- lib/bolt/** | |
- libexec/** | |
- rakelib/tests.rake | |
- spec/** | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
unit: | |
name: Unit | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-latest] | |
ruby: [3.1] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- name: Update gems | |
run: bundle update | |
- name: Cache modules | |
id: modules | |
uses: actions/cache@v1 | |
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 | |
- name: Check installed modules for errors | |
run: | | |
set -e | |
output=$(bundle exec puppet module list --modulepath modules) | |
echo "$output" | |
if echo "$output" | grep -q "Warning: Missing dependency"; then | |
echo "Error: Missing dependencies found in installed modules." | |
exit 1 | |
fi | |
- name: Unit tests | |
run: bundle exec rake tests:unit |