-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (118 loc) · 3.59 KB
/
ci.yml
File metadata and controls
131 lines (118 loc) · 3.59 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
# CI Workflow
# Runs on push to main and pull requests
# Adapt steps to your project's tech stack
name: CI
on:
push:
branches: [main]
paths-ignore: ['**.md', 'docs/**', 'LICENSE', '.editorconfig']
pull_request:
branches: [main]
paths-ignore: ['**.md', 'docs/**', 'LICENSE', '.editorconfig']
# Cancel in-progress runs for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Minimum required permissions (principle of least privilege)
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
# Pinned to SHA for security (update via Dependabot)
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# ============================================
# TEMPLATE: Uncomment the section for your stack
# ============================================
# --- Node.js ---
# - name: Setup Node.js
# uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
# with:
# node-version: 'lts/*'
# cache: 'npm'
#
# - name: Install dependencies
# run: npm ci
#
# - name: Lint
# run: npm run lint
#
# - name: Test
# run: npm test
#
# - name: Build
# run: npm run build
# --- Python ---
# - name: Setup Python
# uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
# with:
# python-version: '3.12'
# cache: 'pip'
#
# - name: Install dependencies
# run: pip install -r requirements.txt
#
# - name: Lint
# run: |
# pip install ruff
# ruff check .
#
# - name: Test
# run: pytest
# --- Go ---
# - name: Setup Go
# uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
# with:
# go-version: 'stable'
#
# - name: Build
# run: go build ./...
#
# - name: Test
# run: go test ./...
# --- Rust ---
# - name: Setup Rust
# uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
# with:
# toolchain: stable
# components: rustfmt, clippy
#
# - name: Rust cache
# uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
#
# - name: Check formatting
# run: cargo fmt --all -- --check
#
# - name: Clippy
# run: cargo clippy --all-targets --all-features -- -D warnings
#
# - name: Test
# run: cargo test --all-features
#
# - name: Build
# run: cargo build --release
# --- Generic (placeholder) ---
- name: Placeholder
run: |
echo "CI workflow running"
echo "Configure this workflow for your tech stack"
echo "See comments above for Node.js, Python, Go, and Rust examples"
# ============================================
# TEMPLATE: Multi-OS matrix example
# Uncomment and replace the 'build' job above to test across OSes.
# ============================================
# build-matrix:
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# runs-on: ${{ matrix.os }}
# timeout-minutes: 15
# steps:
# - name: Checkout
# uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# - name: Build & Test
# run: echo "Running on ${{ matrix.os }}"