Skip to content

Commit 220d3f4

Browse files
committed
Update main CI with all specs ready to go. Comment out release and weekly flows for now since those rely on Earthly and will need to be re-thought later
1 parent 8f19965 commit 220d3f4

File tree

3 files changed

+248
-158
lines changed

3 files changed

+248
-158
lines changed

.github/workflows/ci.yml

Lines changed: 93 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,19 @@ jobs:
7373
crystal: latest
7474
- name: Install shards
7575
run: shards install --skip-postinstall --skip-executables
76-
- name: Install LuckyCLI
76+
- name: Install LuckyCLI
7777
run: |
7878
crystal build src/lucky.cr
7979
pwd >> $GITHUB_PATH
80+
81+
# NOTE: Using `env: SHARDS_OVERRIDE` here doesn't seem to work. It will throw a missing file error on every OS
82+
- name: Run e2e Browser app with authentication flow
83+
if: matrix.os == 'windows-latest'
84+
run: |
85+
$env:SHARDS_OVERRIDE = Join-Path -Path $pwd.Path -ChildPath "shard.override.yml"
86+
crystal spec spec/end_to_end/browser_with_auth_spec.cr
8087
- name: Run e2e Browser app with authentication flow
88+
if: matrix.os != 'windows-latest'
8189
run: SHARDS_OVERRIDE="$(pwd)/shard.override.yml" crystal spec spec/end_to_end/browser_with_auth_spec.cr
8290

8391
browser_without_auth:
@@ -105,9 +113,91 @@ jobs:
105113
crystal: latest
106114
- name: Install shards
107115
run: shards install --skip-postinstall --skip-executables
108-
- name: Install LuckyCLI
116+
- name: Install LuckyCLI
109117
run: |
110118
crystal build src/lucky.cr
111119
pwd >> $GITHUB_PATH
112-
- name: Run e2e Browser app with authentication flow
120+
- name: Run e2e Browser app without authentication flow
121+
if: matrix.os == 'windows-latest'
122+
run: |
123+
$env:SHARDS_OVERRIDE = Join-Path -Path $pwd.Path -ChildPath "shard.override.yml"
124+
crystal spec spec/end_to_end/browser_no_auth_spec.cr
125+
- name: Run e2e Browser app without authentication flow
126+
if: matrix.os != 'windows-latest'
113127
run: SHARDS_OVERRIDE="$(pwd)/shard.override.yml" crystal spec spec/end_to_end/browser_no_auth_spec.cr
128+
129+
api_with_auth:
130+
needs: [check_format, platform_specs]
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
include:
135+
- { os: macos-latest }
136+
- { os: windows-latest }
137+
- { os: ubuntu-latest }
138+
runs-on: ${{matrix.os}}
139+
continue-on-error: false
140+
steps:
141+
- uses: actions/checkout@v6
142+
- name: Setup PostgreSQL
143+
uses: ikalnytskyi/action-setup-postgres@v8
144+
with:
145+
username: postgres
146+
password: postgres
147+
port: 5432
148+
postgres-version: 18
149+
- uses: crystal-lang/install-crystal@v1
150+
with:
151+
crystal: latest
152+
- name: Install shards
153+
run: shards install --skip-postinstall --skip-executables
154+
- name: Install LuckyCLI
155+
run: |
156+
crystal build src/lucky.cr
157+
pwd >> $GITHUB_PATH
158+
- name: Run e2e API app with authentication flow
159+
if: matrix.os == 'windows-latest'
160+
run: |
161+
$env:SHARDS_OVERRIDE = Join-Path -Path $pwd.Path -ChildPath "shard.override.yml"
162+
crystal spec spec/end_to_end/api_with_auth_spec.cr
163+
- name: Run e2e API app with authentication flow
164+
if: matrix.os != 'windows-latest'
165+
run: SHARDS_OVERRIDE="$(pwd)/shard.override.yml" crystal spec spec/end_to_end/api_with_auth_spec.cr
166+
167+
api_without_auth:
168+
needs: [check_format, platform_specs]
169+
strategy:
170+
fail-fast: false
171+
matrix:
172+
include:
173+
- { os: macos-latest }
174+
- { os: windows-latest }
175+
- { os: ubuntu-latest }
176+
runs-on: ${{matrix.os}}
177+
continue-on-error: false
178+
steps:
179+
- uses: actions/checkout@v6
180+
- name: Setup PostgreSQL
181+
uses: ikalnytskyi/action-setup-postgres@v8
182+
with:
183+
username: postgres
184+
password: postgres
185+
port: 5432
186+
postgres-version: 18
187+
- uses: crystal-lang/install-crystal@v1
188+
with:
189+
crystal: latest
190+
- name: Install shards
191+
run: shards install --skip-postinstall --skip-executables
192+
- name: Install LuckyCLI
193+
run: |
194+
crystal build src/lucky.cr
195+
pwd >> $GITHUB_PATH
196+
- name: Run e2e API app without authentication flow
197+
if: matrix.os == 'windows-latest'
198+
run: |
199+
$env:SHARDS_OVERRIDE = Join-Path -Path $pwd.Path -ChildPath "shard.override.yml"
200+
crystal spec spec/end_to_end/api_no_auth_spec.cr
201+
- name: Run e2e API app without authentication flow
202+
if: matrix.os != 'windows-latest'
203+
run: SHARDS_OVERRIDE="$(pwd)/shard.override.yml" crystal spec spec/end_to_end/api_no_auth_spec.cr

.github/workflows/release.yml

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,131 @@
1-
name: Lucky CLI Release
1+
# name: Lucky CLI Release
22

3-
permissions:
4-
contents: write
3+
# permissions:
4+
# contents: write
55

6-
on:
7-
workflow_dispatch:
8-
push:
9-
tags:
10-
# Semantic versions are allowed (i.e. `v1.2.3`)
11-
- "v[0-9]+.[0-9]+.[0-9]+"
12-
# Experimental versions are not allowed (i.e. `v1.2.3-experimental`)
13-
- "!v[0-9]+.[0-9]+.[0-9]+-*"
6+
# on:
7+
# workflow_dispatch:
8+
# push:
9+
# tags:
10+
# # Semantic versions are allowed (i.e. `v1.2.3`)
11+
# - "v[0-9]+.[0-9]+.[0-9]+"
12+
# # Experimental versions are not allowed (i.e. `v1.2.3-experimental`)
13+
# - "!v[0-9]+.[0-9]+.[0-9]+-*"
1414

15-
jobs:
16-
build-linux-amd64:
17-
runs-on: ubuntu-latest
18-
env:
19-
FORCE_COLOR: 1
20-
EARTHLY_CI: 'true'
21-
steps:
22-
- uses: earthly/actions-setup@v1
23-
with:
24-
version: v0.8.0
25-
- uses: actions/checkout@v5
26-
- name: Build and package
27-
run: |
28-
mkdir -p bin
29-
earthly --artifact +release-static/lucky ./bin/lucky
30-
sha256sum bin/lucky | awk '{print $1}' > ./bin/checksums.txt
31-
tar -czvf lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz -C ./bin .
32-
- uses: actions/upload-artifact@v4
33-
with:
34-
name: linux
35-
path: lucky-${{ github.ref_name }}-linux-amd64.tar.gz
36-
if-no-files-found: error
15+
# jobs:
16+
# build-linux-amd64:
17+
# runs-on: ubuntu-latest
18+
# env:
19+
# FORCE_COLOR: 1
20+
# EARTHLY_CI: 'true'
21+
# steps:
22+
# - uses: earthly/actions-setup@v1
23+
# with:
24+
# version: v0.8.0
25+
# - uses: actions/checkout@v5
26+
# - name: Build and package
27+
# run: |
28+
# mkdir -p bin
29+
# earthly --artifact +release-static/lucky ./bin/lucky
30+
# sha256sum bin/lucky | awk '{print $1}' > ./bin/checksums.txt
31+
# tar -czvf lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz -C ./bin .
32+
# - uses: actions/upload-artifact@v4
33+
# with:
34+
# name: linux
35+
# path: lucky-${{ github.ref_name }}-linux-amd64.tar.gz
36+
# if-no-files-found: error
3737

38-
build-windows-amd64:
39-
runs-on: windows-latest
40-
steps:
41-
- uses: actions/checkout@v5
42-
- uses: crystal-lang/install-crystal@v1
43-
- uses: ilammy/msvc-dev-cmd@v1
44-
- name: Build and package
45-
run: |
46-
shards build lucky --without-development --no-debug --release --static
47-
(Get-FileHash ./bin/lucky).Hash | Out-File ./bin/checksums.txt
48-
Compress-Archive -Path ./bin/* -DestinationPath lucky-$env:GITHUB_REF_NAME-windows-amd64.zip
49-
- uses: actions/upload-artifact@v4
50-
with:
51-
name: windows
52-
path: lucky-${{ github.ref_name }}-windows-amd64.zip
53-
if-no-files-found: error
38+
# build-windows-amd64:
39+
# runs-on: windows-latest
40+
# steps:
41+
# - uses: actions/checkout@v5
42+
# - uses: crystal-lang/install-crystal@v1
43+
# - uses: ilammy/msvc-dev-cmd@v1
44+
# - name: Build and package
45+
# run: |
46+
# shards build lucky --without-development --no-debug --release --static
47+
# (Get-FileHash ./bin/lucky).Hash | Out-File ./bin/checksums.txt
48+
# Compress-Archive -Path ./bin/* -DestinationPath lucky-$env:GITHUB_REF_NAME-windows-amd64.zip
49+
# - uses: actions/upload-artifact@v4
50+
# with:
51+
# name: windows
52+
# path: lucky-${{ github.ref_name }}-windows-amd64.zip
53+
# if-no-files-found: error
5454

55-
release:
56-
needs:
57-
- build-linux-amd64
58-
- build-windows-amd64
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v5
62-
- uses: actions/download-artifact@v4
63-
with:
64-
path: artifacts
65-
- name: Checksums
66-
run: |
67-
cd artifacts
68-
sha256sum linux/lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz | awk '{print $1}' > linux/lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz.sha256
69-
sha256sum windows/lucky-$GITHUB_REF_NAME-windows-amd64.zip | awk '{print $1}' > windows/lucky-$GITHUB_REF_NAME-windows-amd64.zip.sha256
70-
- name: Release
71-
uses: softprops/action-gh-release@v2
72-
with:
73-
draft: true
74-
fail_on_unmatched_files: true
75-
files: |
76-
artifacts/linux/lucky-${{ github.ref_name }}-linux-amd64.tar.gz
77-
artifacts/linux/lucky-${{ github.ref_name }}-linux-amd64.tar.gz.sha256
78-
artifacts/windows/lucky-${{ github.ref_name }}-windows-amd64.zip
79-
artifacts/windows/lucky-${{ github.ref_name }}-windows-amd64.zip.sha256
55+
# release:
56+
# needs:
57+
# - build-linux-amd64
58+
# - build-windows-amd64
59+
# runs-on: ubuntu-latest
60+
# steps:
61+
# - uses: actions/checkout@v5
62+
# - uses: actions/download-artifact@v4
63+
# with:
64+
# path: artifacts
65+
# - name: Checksums
66+
# run: |
67+
# cd artifacts
68+
# sha256sum linux/lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz | awk '{print $1}' > linux/lucky-$GITHUB_REF_NAME-linux-amd64.tar.gz.sha256
69+
# sha256sum windows/lucky-$GITHUB_REF_NAME-windows-amd64.zip | awk '{print $1}' > windows/lucky-$GITHUB_REF_NAME-windows-amd64.zip.sha256
70+
# - name: Release
71+
# uses: softprops/action-gh-release@v2
72+
# with:
73+
# draft: true
74+
# fail_on_unmatched_files: true
75+
# files: |
76+
# artifacts/linux/lucky-${{ github.ref_name }}-linux-amd64.tar.gz
77+
# artifacts/linux/lucky-${{ github.ref_name }}-linux-amd64.tar.gz.sha256
78+
# artifacts/windows/lucky-${{ github.ref_name }}-windows-amd64.zip
79+
# artifacts/windows/lucky-${{ github.ref_name }}-windows-amd64.zip.sha256
8080

81-
homebrew-lucky:
82-
needs: release
83-
runs-on: ubuntu-latest
84-
steps:
85-
- uses: actions/checkout@v5
86-
- name: Generate app token
87-
id: generate-token
88-
uses: actions/create-github-app-token@v2
89-
with:
90-
app-id: ${{ vars.APP_ID }}
91-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
92-
- name: Trigger Release Workflow
93-
run: |
94-
url_="https://github.com/luckyframework/lucky_cli/archive/refs/tags/${{ github.ref_name }}.zip"
95-
sha_="$(curl -sL $url_ | sha256sum | awk '{print $1}')"
96-
version_="$(yq '.version' shard.yml)"
81+
# homebrew-lucky:
82+
# needs: release
83+
# runs-on: ubuntu-latest
84+
# steps:
85+
# - uses: actions/checkout@v5
86+
# - name: Generate app token
87+
# id: generate-token
88+
# uses: actions/create-github-app-token@v2
89+
# with:
90+
# app-id: ${{ vars.APP_ID }}
91+
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
92+
# - name: Trigger Release Workflow
93+
# run: |
94+
# url_="https://github.com/luckyframework/lucky_cli/archive/refs/tags/${{ github.ref_name }}.zip"
95+
# sha_="$(curl -sL $url_ | sha256sum | awk '{print $1}')"
96+
# version_="$(yq '.version' shard.yml)"
9797

98-
set -x
99-
gh workflow run release.yml \
100-
-R luckyframework/homebrew-lucky \
101-
-f url=$url_ \
102-
-f sha256=$sha_ \
103-
-f version=$version_
104-
env:
105-
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
98+
# set -x
99+
# gh workflow run release.yml \
100+
# -R luckyframework/homebrew-lucky \
101+
# -f url=$url_ \
102+
# -f sha256=$sha_ \
103+
# -f version=$version_
104+
# env:
105+
# GH_TOKEN: ${{ steps.generate-token.outputs.token }}
106106

107-
scoop-lucky:
108-
needs: release
109-
runs-on: ubuntu-latest
110-
steps:
111-
- uses: actions/checkout@v5
112-
- name: Generate app token
113-
id: generate-token
114-
uses: actions/create-github-app-token@v2
115-
with:
116-
app-id: ${{ vars.APP_ID }}
117-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
118-
- name: Trigger Release Workflow
119-
run: |
120-
url_="https://github.com/luckyframework/lucky_cli/releases/download/${{ github.ref_name }}/lucky-${{ github.ref_name }}-windows-amd64.zip"
121-
sha_="$(curl -sL $url_.sha256)"
122-
version_="$(yq '.version' shard.yml)"
107+
# scoop-lucky:
108+
# needs: release
109+
# runs-on: ubuntu-latest
110+
# steps:
111+
# - uses: actions/checkout@v5
112+
# - name: Generate app token
113+
# id: generate-token
114+
# uses: actions/create-github-app-token@v2
115+
# with:
116+
# app-id: ${{ vars.APP_ID }}
117+
# private-key: ${{ secrets.APP_PRIVATE_KEY }}
118+
# - name: Trigger Release Workflow
119+
# run: |
120+
# url_="https://github.com/luckyframework/lucky_cli/releases/download/${{ github.ref_name }}/lucky-${{ github.ref_name }}-windows-amd64.zip"
121+
# sha_="$(curl -sL $url_.sha256)"
122+
# version_="$(yq '.version' shard.yml)"
123123

124-
set -x
125-
gh workflow run release.yml \
126-
-R luckyframework/scoop-bucket \
127-
-f url=$url_ \
128-
-f sha256=$sha_ \
129-
-f version=$version_
130-
env:
131-
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
124+
# set -x
125+
# gh workflow run release.yml \
126+
# -R luckyframework/scoop-bucket \
127+
# -f url=$url_ \
128+
# -f sha256=$sha_ \
129+
# -f version=$version_
130+
# env:
131+
# GH_TOKEN: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)