|
8 | 8 |
|
9 | 9 | env: |
10 | 10 | FORCE_COLOR: 1 |
11 | | - EARTHLY_CI: 'true' |
12 | | - EARTHLY_ALLOW_PRIVILEGED: 'true' |
| 11 | + LUCKY_ENV: test |
| 12 | + SHARDS_OVERRIDE: "$(pwd)/shard.override.yml" |
13 | 13 |
|
14 | 14 | jobs: |
15 | | - specs: |
| 15 | + check_format: |
| 16 | + strategy: |
| 17 | + fail-fast: false |
16 | 18 | runs-on: ubuntu-latest |
| 19 | + continue-on-error: false |
17 | 20 | steps: |
18 | | - - uses: earthly/actions-setup@v1 |
| 21 | + - uses: actions/checkout@v6 |
| 22 | + - uses: crystal-lang/install-crystal@v1 |
19 | 23 | with: |
20 | | - version: v0.8.0 |
21 | | - - uses: actions/checkout@v5 |
22 | | - - name: Run build |
23 | | - run: | |
24 | | - earthly +gh-action-essential |
| 24 | + crystal: latest |
| 25 | + - name: Install shards |
| 26 | + run: shards install |
| 27 | + - name: Format |
| 28 | + run: crystal tool format --check |
25 | 29 |
|
26 | 30 | platform-specs: |
27 | | - needs: specs |
| 31 | + needs: check_format |
28 | 32 | strategy: |
29 | 33 | fail-fast: false |
30 | 34 | matrix: |
31 | 35 | include: |
32 | | - - {os: macos-latest} |
33 | | - - {os: windows-latest} |
| 36 | + - { os: macos-latest } |
| 37 | + - { os: windows-latest } |
| 38 | + - { os: ubuntu-latest } |
34 | 39 | runs-on: ${{matrix.os}} |
35 | 40 | steps: |
36 | | - - uses: actions/checkout@v5 |
| 41 | + - uses: actions/checkout@v6 |
37 | 42 | - uses: crystal-lang/install-crystal@v1 |
38 | 43 | with: |
39 | 44 | crystal: latest |
40 | 45 | - name: Install shards |
41 | 46 | run: shards install |
42 | | - - name: Run specs |
43 | | - run: crystal spec --tag "~integration" |
| 47 | + - name: Run unit and integration specs |
| 48 | + run: crystal spec spec/integration/ spec/unit/ |
44 | 49 |
|
45 | | - integration-specs: |
46 | | - needs: specs |
47 | | - runs-on: ubuntu-latest |
| 50 | + # NOTE: These e2e specs will take a while to run |
| 51 | + browser_with_auth: |
| 52 | + needs: [check_format, platform-specs] |
| 53 | + fail-fast: false |
| 54 | + matrix: |
| 55 | + include: |
| 56 | + - { os: macos-latest } |
| 57 | + - { os: windows-latest } |
| 58 | + - { os: ubuntu-latest } |
| 59 | + runs-on: ${{matrix.os}} |
| 60 | + services: |
| 61 | + postgres: |
| 62 | + image: postgres:18-alpine |
| 63 | + env: |
| 64 | + POSTGRES_USER: postgres |
| 65 | + POSTGRES_PASSWORD: postgres |
| 66 | + ports: |
| 67 | + - 5432:5432 |
| 68 | + # needed because the postgres container does not provide a healthcheck |
| 69 | + options: >- |
| 70 | + --health-cmd pg_isready |
| 71 | + --health-interval 10s |
| 72 | + --health-timeout 5s |
| 73 | + --health-retries 5 |
48 | 74 | steps: |
49 | | - - uses: earthly/actions-setup@v1 |
| 75 | + - uses: actions/checkout@v6 |
| 76 | + - uses: crystal-lang/install-crystal@v1 |
50 | 77 | with: |
51 | | - version: v0.8.0 |
52 | | - - uses: actions/checkout@v5 |
53 | | - - name: Run build |
54 | | - run: | |
55 | | - earthly +gh-action-integration |
| 78 | + crystal: latest |
| 79 | + - name: Install shards |
| 80 | + run: shards install --skip-postinstall --skip-executables |
| 81 | + - name: Run e2e Browser app with authentication flow |
| 82 | + run: crystal spec spec/end_to_end/browser_with_auth_spec.cr |
56 | 83 |
|
57 | | - e2e-specs: |
58 | | - needs: integration-specs |
59 | | - runs-on: ubuntu-latest |
| 84 | + browser_without_auth: |
| 85 | + needs: [check_format, platform-specs] |
| 86 | + fail-fast: false |
| 87 | + matrix: |
| 88 | + include: |
| 89 | + - { os: macos-latest } |
| 90 | + - { os: windows-latest } |
| 91 | + - { os: ubuntu-latest } |
| 92 | + runs-on: ${{matrix.os}} |
| 93 | + services: |
| 94 | + postgres: |
| 95 | + image: postgres:18-alpine |
| 96 | + env: |
| 97 | + POSTGRES_USER: postgres |
| 98 | + POSTGRES_PASSWORD: postgres |
| 99 | + ports: |
| 100 | + - 5432:5432 |
| 101 | + # needed because the postgres container does not provide a healthcheck |
| 102 | + options: >- |
| 103 | + --health-cmd pg_isready |
| 104 | + --health-interval 10s |
| 105 | + --health-timeout 5s |
| 106 | + --health-retries 5 |
60 | 107 | steps: |
61 | | - - uses: earthly/actions-setup@v1 |
| 108 | + - uses: actions/checkout@v6 |
| 109 | + - uses: crystal-lang/install-crystal@v1 |
62 | 110 | with: |
63 | | - version: v0.8.0 |
64 | | - - uses: actions/checkout@v5 |
65 | | - - name: Run build |
66 | | - run: | |
67 | | - earthly +gh-action-e2e |
| 111 | + crystal: latest |
| 112 | + - name: Install shards |
| 113 | + run: shards install --skip-postinstall --skip-executables |
| 114 | + - name: Run e2e Browser app with authentication flow |
| 115 | + run: crystal spec spec/end_to_end/browser_no_auth_spec.cr |
0 commit comments