-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (142 loc) · 3.69 KB
/
CI.yaml
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
144
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: '0 9 * * 0'
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Prettier
run: bun --bun run format:check
eslint:
name: ESLint
runs-on: ubuntu-latest
needs:
- prettier
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: ESLint
run: bun --bun run lint:eslint
svelte-check:
name: Svelte Check
runs-on: ubuntu-latest
needs:
- prettier
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Svelte Check
run: bun --bun run check:ci
test:
name: Test
runs-on: ubuntu-latest
needs:
- prettier
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Test
run: bun test
build:
name: Build
runs-on: ubuntu-latest
needs:
- eslint
- svelte-check
- test
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun --bun run build:ci
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build
path: .svelte-kit/cloudflare
codeql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['javascript']
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
#deploy:
# name: Deploy to Cloudflare Pages
# runs-on: ubuntu-latest
# needs:
# - build
# - codeql
# timeout-minutes: 5
# permissions:
# contents: read
# pages: write
# id-token: write
# environment:
# name: Cloudflare Pages
# url: ${{ steps.deployment.outputs.url}}
# steps:
# - name: Download build artifact
# uses: actions/download-artifact@v3
# with:
# name: build
# path: .svelte-kit/cloudflare
# - name: Publish to Cloudflare Pages
# id: deployment
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.CLOUDFLARE_DEPLOYMENT_KEY }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# projectName: portfolio
# directory: .svelte-kit/cloudflare
# branch: ${{ github.ref_name}}
# # Optional: Enable this if you want to have GitHub Deployments triggered
# gitHubToken: ${{ github.token }}