From afe76fab61e6e9c094f2f19599a856ed4ef4b8f5 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Sun, 2 Oct 2022 09:33:43 +0100 Subject: [PATCH] (MAINT) Add CI and release workflows --- .github/workflows/ci.yml | 70 +++++------------------------- .github/workflows/release.yml | 16 +++++++ .github/workflows/release_prep.yml | 16 +++++++ 3 files changed, 44 insertions(+), 58 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release_prep.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75508416..6fbd58d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,66 +1,20 @@ -name: CI +name: "ci" on: push: - branches: [master] + branches: + - master pull_request: - branches: [master] + branches: + - master schedule: - - cron: "3 0 * * *" + - cron: "0 0 * * *" + workflow_dispatch: jobs: - lint: - name: RuboCop - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - run: bundle exec rake rubocop + ci: + uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" + with: + with_acceptance: false + secrets: "inherit" - spec: - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "windows-latest"] - ruby: - - "2.4" - - "2.5" - - "2.7" - needs: lint - name: RSpec - ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - runs-on: ${{ matrix.os }} - env: - COVERAGE: yes - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rake - - release_tests: - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest", "windows-latest"] - ruby: - - "2.4" - - "2.5" - - "2.7" - needs: lint - name: Release Tests - ${{ matrix.os }} - Ruby ${{ matrix.ruby }} - runs-on: ${{ matrix.os }} - env: - BUNDLE_WITHOUT: development system_tests - CHECK: ci - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rake ci diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7fcfd4b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,16 @@ +name: "Release" + +on: + workflow_dispatch: + inputs: + target: + description: "The target for the release. This can be a commit sha or a branch." + required: false + default: "main" + +jobs: + release: + uses: "puppetlabs/cat-github-actions/.github/workflows/gem_release.yml@main" + with: + target: "${{ github.event.inputs.target }}" + secrets: "inherit" diff --git a/.github/workflows/release_prep.yml b/.github/workflows/release_prep.yml new file mode 100644 index 00000000..4d564765 --- /dev/null +++ b/.github/workflows/release_prep.yml @@ -0,0 +1,16 @@ +name: "Release Prep" + +on: + workflow_dispatch: + inputs: + target: + description: "The target for the release. This can be a commit sha or a branch." + required: false + default: "main" + +jobs: + release_prep: + uses: "puppetlabs/cat-github-actions/.github/workflows/gem_release_prep.yml@main" + with: + target: "${{ github.event.inputs.target }}" + secrets: "inherit"