From 74d0db99bac9543c22614e2365bf5fbadae7bf4c Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 12 Jan 2021 09:56:33 +0100 Subject: [PATCH 1/5] Replace Travis CI with GitHub Actions --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ .travis.yml | 6 ------ 2 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c482423 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: Ruby + on: + push: + branches: + - master + pull_request: + branches: + - master + jobs: + test: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + os: + - ubuntu + ruby: + - "2.5" + - "2.6" + - "2.7" + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Install dependencies + run: bundle install + - name: Run tests + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b2552e0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: ruby -cache: bundler -rvm: - - 2.7 - - 2.6 - - 2.5 From 05f19c60fbaead557faa2f230816058860f8a4bb Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 12 Jan 2021 10:27:51 +0100 Subject: [PATCH 2/5] CI: Fix indentation issue I used the GitHub tools, the online editor explained the format to me, and I searched the Web and saw this article: which explained it, too: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-ruby --- .github/workflows/ci.yml | 60 ++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c482423..be636b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,31 +1,31 @@ name: Ruby - on: - push: - branches: - - master - pull_request: - branches: - - master - jobs: - test: - runs-on: ubuntu-18.04 - strategy: - fail-fast: false - matrix: - os: - - ubuntu - ruby: - - "2.5" - - "2.6" - - "2.7" - steps: - - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - name: Install dependencies - run: bundle install - - name: Run tests - run: bundle exec rake +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + test: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + os: + - ubuntu + ruby: + - "2.5" + - "2.6" + - "2.7" + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Install dependencies + run: bundle install + - name: Run tests + run: bundle exec rake From 406932c57d8157a664f7e2d7f256047d4bd17298 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 12 Jan 2021 10:33:37 +0100 Subject: [PATCH 3/5] CI: Refer to $default-branch This allows the default branch to be renamed without a hitch. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be636b0..5b663e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: Ruby on: push: branches: - - master + - $default-branch pull_request: branches: - - master + - $default-branch jobs: test: runs-on: ubuntu-18.04 From 727fad96a00d01c32fd9abc119b65190732e878b Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 12 Jan 2021 10:36:03 +0100 Subject: [PATCH 4/5] CI: Refer to $matrix.os-latest I hope this will allow updates behind the scenes. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b663e0..e2a3fd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: - $default-branch jobs: test: - runs-on: ubuntu-18.04 + runs-on: ${{ matrix.os }}-latest strategy: fail-fast: false matrix: From e216846555c81e352e0eed89dbc682a254b75f50 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Tue, 12 Jan 2021 10:40:14 +0100 Subject: [PATCH 5/5] CI: Allow more commits to trigger CI Both on PR and push. --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2a3fd4..5240776 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,7 @@ name: Ruby -on: - push: - branches: - - $default-branch - pull_request: - branches: - - $default-branch + +on: [push, pull_request] + jobs: test: runs-on: ${{ matrix.os }}-latest