Skip to content

Commit e9a29c7

Browse files
committed
Working new CI flow with some updates. Testing if this will actually work
1 parent 291cf3f commit e9a29c7

12 files changed

+89
-305
lines changed

.github/workflows/ci.yml

Lines changed: 81 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,60 +8,108 @@ on:
88

99
env:
1010
FORCE_COLOR: 1
11-
EARTHLY_CI: 'true'
12-
EARTHLY_ALLOW_PRIVILEGED: 'true'
11+
LUCKY_ENV: test
12+
SHARDS_OVERRIDE: "$(pwd)/shard.override.yml"
1313

1414
jobs:
15-
specs:
15+
check_format:
16+
strategy:
17+
fail-fast: false
1618
runs-on: ubuntu-latest
19+
continue-on-error: false
1720
steps:
18-
- uses: earthly/actions-setup@v1
21+
- uses: actions/checkout@v6
22+
- uses: crystal-lang/install-crystal@v1
1923
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
2529

2630
platform-specs:
27-
needs: specs
31+
needs: check_format
2832
strategy:
2933
fail-fast: false
3034
matrix:
3135
include:
32-
- {os: macos-latest}
33-
- {os: windows-latest}
36+
- { os: macos-latest }
37+
- { os: windows-latest }
38+
- { os: ubuntu-latest }
3439
runs-on: ${{matrix.os}}
3540
steps:
36-
- uses: actions/checkout@v5
41+
- uses: actions/checkout@v6
3742
- uses: crystal-lang/install-crystal@v1
3843
with:
3944
crystal: latest
4045
- name: Install shards
4146
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/
4449

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
4874
steps:
49-
- uses: earthly/actions-setup@v1
75+
- uses: actions/checkout@v6
76+
- uses: crystal-lang/install-crystal@v1
5077
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
5683

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
60107
steps:
61-
- uses: earthly/actions-setup@v1
108+
- uses: actions/checkout@v6
109+
- uses: crystal-lang/install-crystal@v1
62110
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

shard.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ authors:
77
targets:
88
lucky:
99
main: src/lucky.cr
10-
lucky.hello_world:
11-
main: fixtures/hello_world.cr
1210

1311
crystal: ~> 1.16
1412

spec/end_to_end/browser_no_auth_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe "Lucky CLI", tags: "end_to_end" do
1414
should_run_successfully "crystal script/setup.cr"
1515
should_run_successfully "crystal build src/test_project.cr"
1616
should_run_successfully "crystal spec"
17-
should_run_successfully "crystal run ../src/lucky.cr -- tasks"
17+
# should_run_successfully "crystal run ../src/lucky.cr -- tasks"
1818
end
1919
end
2020
end

spec/end_to_end/browser_with_auth_spec.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe "Lucky CLI", tags: "end_to_end" do
1414
should_run_successfully "crystal script/setup.cr"
1515
should_run_successfully "crystal build src/test_project.cr"
1616
should_run_successfully "crystal spec"
17-
should_run_successfully "crystal run ../src/lucky.cr -- tasks"
17+
# should_run_successfully "crystal run ../src/lucky.cr -- tasks"
1818
end
1919
end
2020
end

spec/unit/api_authentication_template_spec.cr

Lines changed: 0 additions & 18 deletions
This file was deleted.

spec/unit/app_with_sec_tester_template_spec.cr

Lines changed: 0 additions & 48 deletions
This file was deleted.

spec/unit/base_authentication_src_template_spec.cr

Lines changed: 0 additions & 18 deletions
This file was deleted.

spec/unit/browser_authentication_src_template_spec.cr

Lines changed: 0 additions & 18 deletions
This file was deleted.

spec/unit/browser_src_template_spec.cr

Lines changed: 0 additions & 24 deletions
This file was deleted.

spec/unit/shard_file_generator_spec.cr

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)