From 2ea901448a6f5cc56b2851816293624a05fb7abc Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Mon, 16 Nov 2020 13:38:32 +0800 Subject: [PATCH] * Create GitHub Workflow config to simulate Travis builds --- .github/workflows/tests.yaml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..85c8fbf --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,60 @@ +name: Tests + +on: + pull_request: + branches: + - master + paths-ignore: + - 'README.md' + push: + branches: + - master + paths-ignore: + - 'README.md' + +jobs: + unit_tests: + name: Unit Tests + if: "contains(github.event.commits[0].message, '[ci skip]') == false" + strategy: + fail-fast: false + matrix: + os: + - ubuntu + ruby: + - 2.2 + - 2.3 + - 2.4 + - 2.5 + - 2.6 + - 2.7 + allow_failures: + - false + include: + - os: ubuntu + ruby: ruby-head + allow_failures: true + env: + BUNDLE_PATH: "./vendor/bundle" + ALLOW_FAILURES: "${{ matrix.allow_failures }}" + runs-on: ${{ matrix.os }}-latest + continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v2 + with: + path: vendor/bundle + key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ github.ref }}-${{ github.sha }}-v2 + restore-keys: | + ${{ runner.os }}-gems--${{ matrix.ruby }}-${{ github.ref }}- + ${{ runner.os }}-gems--${{ matrix.ruby }}- + - name: Bundle Install + run: | + bundle install --jobs 4 --retry 3 + - name: Test + run: COVERAGE=true bundle exec rspec || $ALLOW_FAILURES