From 6b40ca7c12a189e4f605050ebabbf85d4b4c763e Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 8 May 2024 13:21:45 +0200 Subject: [PATCH] add GHA based tests --- .github/dependabot.yml | 9 ++++++ .github/workflows/test.yml | 63 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..93ca4a7f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +--- +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..8acbfe40 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,63 @@ +--- +name: Test + +on: + pull_request: + push: + branches: + - 'develop' + - '*-stable' + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true + +jobs: + rubocop: + name: Rubocop + uses: theforeman/actions/.github/workflows/rubocop.yml@v0 + + test: + name: "Ruby ${{ matrix.ruby }} / Puppet ${{ matrix.puppet }}" + needs: rubocop + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - ruby: '2.7' + puppet: '7.0' + - ruby: '3.0' + puppet: '7.0' + - ruby: '3.2' + puppet: '8.0' + env: + PUPPET_VERSION: ${{ matrix.puppet }} + steps: + - uses: actions/checkout@v4 + - name: Install system dependencies + run: sudo apt-get install -y --no-install-recommends asciidoc + - name: Setup ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Archive Gemfile.lock + uses: actions/upload-artifact@v4 + with: + name: Gemfile-ruby-${{ matrix.ruby }}-puppet-${{ matrix.puppet }}.lock + path: Gemfile.lock + - name: Run tests + run: bundle exec rake spec + - name: Test installer configuration + run: | + bundle exec rake install PREFIX=./local --trace + bundle exec rake installation_tests PREFIX=./local --trace + + # A dummy job that you can mark as a required check instead of each individual test + test-suite: + needs: test + runs-on: ubuntu-latest + name: Test suite + steps: + - run: echo Test suite completed