From 199ea8c15497b1b5849d36879f55bf7203e107c0 Mon Sep 17 00:00:00 2001 From: apainintheneck Date: Sat, 18 Nov 2023 00:16:00 -0800 Subject: [PATCH] Add github actions - docs: checks that readme has been generated correctly - tests: linting and tests --- .github/workflows/docs.yml | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..f74b5a0 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,20 @@ +name: Docs +on: + push: + branches: master + pull_request: +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@main + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' + bundler-cache: true + + - name: Outdated readme check + run: bundle exec readme:outdated diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..eac71b2 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,27 @@ +name: CI +on: + push: + branches: master + pull_request: +jobs: + tests: + strategy: + matrix: + platform: ["ubuntu-latest", "macos-latest"] + ruby: [2.7, 3.0, 3.1, 3.2] + runs-on: ${{ matrix.platform }} + steps: + - name: Set up Git repository + uses: actions/checkout@main + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Run linter + run: bundle exec rake lint + + - name: Run tests + run: bundle exec rake test