|
| 1 | +--- |
| 2 | +name: Test |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "*" |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - "*" |
| 10 | +jobs: |
| 11 | + main: |
| 12 | + name: Main |
| 13 | + timeout-minutes: 30 |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: ["ubuntu-latest"] |
| 17 | + redis: ["5.0"] |
| 18 | + ruby: ["2.7", "2.6", "2.5", "2.4"] |
| 19 | + driver: ["ruby", "hiredis", "synchrony"] |
| 20 | + runs-on: ${{ matrix.os }} |
| 21 | + env: |
| 22 | + VERBOSE: true |
| 23 | + TIMEOUT: 30 |
| 24 | + LOW_TIMEOUT: 0.01 |
| 25 | + DRIVER: ${{ matrix.driver }} |
| 26 | + REDIS_BRANCH: ${{ matrix.redis }} |
| 27 | + steps: |
| 28 | + - name: Check out code |
| 29 | + uses: actions/checkout@v2 |
| 30 | + - name: Print environment variables |
| 31 | + run: | |
| 32 | + echo "TIMEOUT=${TIMEOUT}" |
| 33 | + echo "LOW_TIMEOUT=${LOW_TIMEOUT}" |
| 34 | + echo "DRIVER=${DRIVER}" |
| 35 | + echo "REDIS_BRANCH=${REDIS_BRANCH}" |
| 36 | + - name: Set up Ruby |
| 37 | + uses: actions/setup-ruby@v1 |
| 38 | + with: |
| 39 | + ruby-version: ${{ matrix.ruby }} |
| 40 | + - name: Cache dependent gems |
| 41 | + uses: actions/cache@v1 |
| 42 | + with: |
| 43 | + path: .bundle |
| 44 | + key: "local-bundle-ruby-${{ matrix.ruby }}-on-${{ matrix.os }}-0001" |
| 45 | + - name: Set up Gems |
| 46 | + run: | |
| 47 | + gem update --system --no-document |
| 48 | + gem install bundler --no-document |
| 49 | + bundle install --jobs 4 --retry 3 --path=.bundle |
| 50 | + - name: Cache local temporary directory |
| 51 | + uses: actions/cache@v1 |
| 52 | + with: |
| 53 | + path: tmp |
| 54 | + key: "local-tmp-redis-${{ matrix.redis }}-on-${{ matrix.os }}" |
| 55 | + - name: Booting up Redis |
| 56 | + run: make start_all |
| 57 | + - name: Test |
| 58 | + run: make test |
| 59 | + env: |
| 60 | + RUBYOPT: "--enable-frozen-string-literal" |
| 61 | + - name: Shutting down Redis |
| 62 | + run: make stop_all |
| 63 | + sub: |
| 64 | + name: Sub |
| 65 | + timeout-minutes: 30 |
| 66 | + strategy: |
| 67 | + matrix: |
| 68 | + os: ["ubuntu-latest"] |
| 69 | + redis: ["5.0", "4.0", "3.2", "3.0"] |
| 70 | + ruby: ["jruby-9.2.9.0", "2.3"] |
| 71 | + driver: ["ruby"] |
| 72 | + runs-on: ${{ matrix.os }} |
| 73 | + env: |
| 74 | + VERBOSE: true |
| 75 | + TIMEOUT: 30 |
| 76 | + LOW_TIMEOUT: 0.03 |
| 77 | + DRIVER: ${{ matrix.driver }} |
| 78 | + REDIS_BRANCH: ${{ matrix.redis }} |
| 79 | + steps: |
| 80 | + - name: Check out code |
| 81 | + uses: actions/checkout@v2 |
| 82 | + - name: Print environment variables |
| 83 | + run: | |
| 84 | + echo "TIMEOUT=${TIMEOUT}" |
| 85 | + echo "LOW_TIMEOUT=${LOW_TIMEOUT}" |
| 86 | + echo "DRIVER=${DRIVER}" |
| 87 | + echo "REDIS_BRANCH=${REDIS_BRANCH}" |
| 88 | + - name: Set up Ruby |
| 89 | + uses: ruby/setup-ruby@v1 |
| 90 | + with: |
| 91 | + ruby-version: ${{ matrix.ruby }} |
| 92 | + - name: Cache dependent gems |
| 93 | + uses: actions/cache@v1 |
| 94 | + with: |
| 95 | + path: .bundle |
| 96 | + key: "local-bundle-ruby-${{ matrix.ruby }}-on-${{ matrix.os }}-0001" |
| 97 | + - name: Set up Gems |
| 98 | + run: | |
| 99 | + gem update --system --no-document |
| 100 | + gem install bundler --no-document |
| 101 | + bundle install --jobs 4 --retry 3 --path=.bundle |
| 102 | + - name: Cache local temporary directory |
| 103 | + uses: actions/cache@v1 |
| 104 | + with: |
| 105 | + path: tmp |
| 106 | + key: "local-tmp-redis-${{ matrix.redis }}-on-${{ matrix.os }}" |
| 107 | + - name: Booting up Redis |
| 108 | + run: make start_all |
| 109 | + - name: Test |
| 110 | + run: make test |
| 111 | + - name: Shutting down Redis |
| 112 | + run: make stop_all |
0 commit comments