-
-
Notifications
You must be signed in to change notification settings - Fork 28
143 lines (134 loc) · 4.68 KB
/
publish.yml
File metadata and controls
143 lines (134 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Publish Package to npm
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions: write-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo tarpaulin and fmt
run: |
cargo install cargo-tarpaulin
rustup component add rustfmt clippy
- uses: oven-sh/setup-bun@v2
name: Install bun
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: 'latest'
- name: Install Node.js
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: 22
- run: bun install
- run: bun run build
- name: Benchmark
run: bun run benchmark
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cargo tarpaulin and fmt
run: |
cargo install cargo-tarpaulin
rustup component add rustfmt clippy
- uses: oven-sh/setup-bun@v2
name: Install bun
- uses: jetli/wasm-pack-action@v0.4.0
with:
version: 'latest'
- name: Install Node.js
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
node-version: 22
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: bun install
- run: bun run build
- run: |
bun run lint
# rust coverage issue
echo 'max_width = 100000' > .rustfmt.toml
echo 'tab_spaces = 4' >> .rustfmt.toml
echo 'newline_style = "Unix"' >> .rustfmt.toml
echo 'fn_call_width = 100000' >> .rustfmt.toml
echo 'fn_params_layout = "Compressed"' >> .rustfmt.toml
echo 'chain_width = 100000' >> .rustfmt.toml
echo 'merge_derives = true' >> .rustfmt.toml
echo 'use_small_heuristics = "Default"' >> .rustfmt.toml
cargo fmt
- run: bun run test
- name: Format Rollback
run: |
rm -rf .rustfmt.toml
cargo fmt
- name: Build Landing
run: |
bun run --filter @devup-ui/components build-storybook
mv ./packages/components/storybook-static ./apps/landing/public/storybook
bun run --filter landing build
- name: Install Playwright Browsers
run: bunx playwright install chromium --with-deps
- name: Check for Existing E2E Snapshots
id: check-snapshots
run: |
SNAPSHOT_COUNT=$(find e2e -name '*.png' -path '*-snapshots/*' 2>/dev/null | wc -l)
echo "count=$SNAPSHOT_COUNT" >> $GITHUB_OUTPUT
echo "Found $SNAPSHOT_COUNT existing snapshot(s)"
- name: Generate E2E Snapshots
if: steps.check-snapshots.outputs.count == '0'
run: bunx playwright test --update-snapshots
- name: Commit E2E Snapshots
if: steps.check-snapshots.outputs.count == '0' && github.event_name == 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: generate e2e visual snapshots from CI"
file_pattern: "e2e/**/*-snapshots/*.png"
- name: Run E2E Tests
run: bun run test:e2e
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./apps/landing/out
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- uses: actions/deploy-pages@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- name: Build Landing (singleCss)
run: |
rm -rf apps/landing/out apps/landing/.next apps/landing/df
DEVUP_SINGLE_CSS=1 bun run --filter landing build
- name: Run E2E Tests (singleCss)
run: bun run test:e2e
- name: Upload singleCss Playwright Report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report-singlecss
path: playwright-report/
retention-days: 30
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage/lcov.info
- uses: changepacks/action@main
id: changepacks
with:
publish: true
env:
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}