|
1 | 1 | name: "Compile and test the date gem" |
2 | 2 | on: [push] |
3 | 3 | jobs: |
4 | | - compile_and_test: |
5 | | - name: "Complile and test the date gem" |
| 4 | + compile: |
| 5 | + timeout-minutes: 10 # TODO This should be configurable |
| 6 | + name: "Cross compile the gem on different ruby versions" |
6 | 7 | strategy: |
7 | 8 | matrix: |
8 | | - version: ["3.4.4"] |
9 | | - os: ["ubuntu-latest"] |
| 9 | + os: ["ubuntu-latest", "macos-latest"] |
10 | 10 | runs-on: "${{ matrix.os }}" |
11 | 11 | steps: |
12 | 12 | - name: "Checkout code" |
13 | 13 | uses: "actions/checkout@v5" |
14 | 14 | - name: "Setup Ruby" |
15 | 15 | uses: "ruby/setup-ruby@v1" |
16 | 16 | with: |
17 | | - ruby-version: "${{ matrix.version }}" |
| 17 | + ruby-version: "3.4.7" # TODO This should be determined dynamically. |
18 | 18 | bundler-cache: true |
19 | 19 | working-directory: "test/fixtures/date" |
20 | 20 | - name: "Run easy compile" |
21 | 21 | uses: "./.github/actions/easy_compile" |
22 | 22 | with: |
23 | 23 | working-directory: "test/fixtures/date" |
| 24 | + step: "compile" |
| 25 | + test: |
| 26 | + permissions: # TODO This can be removed. I just need this temporarily to download the artifact from a previous workflow |
| 27 | + actions: read |
| 28 | + contents: read |
| 29 | + timeout-minutes: 10 # TODO This should be configurable |
| 30 | + name: "Run the test suite" |
| 31 | + needs: compile |
| 32 | + strategy: |
| 33 | + matrix: |
| 34 | + os: ["ubuntu-latest", "macos-latest"] |
| 35 | + rubies: ["3.0.7", "3.1.7", "3.2.9", "3.3.9", "3.4.6"] # TODO This should be determined dynamically. |
| 36 | + type: ["cross", "native"] |
| 37 | + runs-on: "${{ matrix.os }}" |
| 38 | + steps: |
| 39 | + - name: "Checkout code" |
| 40 | + uses: "actions/checkout@v5" |
| 41 | + - name: "Setup Ruby" |
| 42 | + uses: "ruby/setup-ruby@v1" |
| 43 | + with: |
| 44 | + ruby-version: "${{ matrix.rubies }}" |
| 45 | + bundler-cache: true |
| 46 | + working-directory: "test/fixtures/date" |
| 47 | + - name: "Run easy compile" |
| 48 | + uses: "./.github/actions/easy_compile" |
| 49 | + with: |
| 50 | + working-directory: "test/fixtures/date" |
| 51 | + step: "test_${{ matrix.type }}" |
| 52 | + token: ${{ secrets.GITHUB_TOKEN }} # TODO This can be removed. Only for testing |
| 53 | + install: |
| 54 | + permissions: # TODO This can be removed. I just need this temporarily to download the artifact from a previous workflow |
| 55 | + actions: read |
| 56 | + contents: read |
| 57 | + timeout-minutes: 5 |
| 58 | + name: "Verify the gem can be installed" |
| 59 | + needs: test |
| 60 | + strategy: |
| 61 | + matrix: |
| 62 | + os: ["ubuntu-latest", "macos-latest"] |
| 63 | + runs-on: "${{ matrix.os }}" |
| 64 | + steps: |
| 65 | + - name: "Checkout code" # TODO No need to checkout the codebase. Have to do it here because the relative path to the action doesn't work otherwise. |
| 66 | + uses: "actions/checkout@v5" |
| 67 | + - name: "Setup Ruby" |
| 68 | + uses: "ruby/setup-ruby@v1" |
| 69 | + with: |
| 70 | + ruby-version: "3.4.7" # TODO This needs to be determined dynamically. |
| 71 | + - name: "Run easy compile" |
| 72 | + uses: "./.github/actions/easy_compile" |
| 73 | + with: |
| 74 | + step: "install" |
| 75 | + release: |
| 76 | + permissions: # TODO This can be removed. I just need this temporarily to download the artifact from a previous workflow |
| 77 | + actions: read |
| 78 | + contents: read |
| 79 | + id-token: write |
| 80 | + timeout-minutes: 5 |
| 81 | + name: "Release all gems with RubyGems" |
| 82 | + needs: install |
| 83 | + runs-on: "ubuntu-latest" |
| 84 | + steps: |
| 85 | + - name: "Checkout code" # TODO No need to checkout the codebase. Have to do it here because the relative path to the action doesn't work otherwise. |
| 86 | + uses: "actions/checkout@v5" |
| 87 | + - name: "Setup Ruby" |
| 88 | + uses: "ruby/setup-ruby@v1" |
| 89 | + with: |
| 90 | + ruby-version: "3.4.7" |
| 91 | + bundler-cache: true |
| 92 | + working-directory: "test/fixtures/date" |
| 93 | + - name: "Run easy compile" |
| 94 | + uses: "./.github/actions/easy_publish" |
| 95 | + with: |
| 96 | + working-directory: "test/fixtures/date" |
| 97 | + token: "${{ secrets.GITHUB_TOKEN }}" |
0 commit comments