-
-
Notifications
You must be signed in to change notification settings - Fork 57
59 lines (50 loc) · 1.37 KB
/
Copy pathci.yml
File metadata and controls
59 lines (50 loc) · 1.37 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
name: CI
on:
push:
branches:
- master
paths:
- src/**
- package*.json
- eslint.config.js
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@v6
- if: ${{ github.event_name == 'pull_request' }}
name: Upload artifact (pull_request)
uses: actions/upload-artifact@v7
with:
name: XKit Rewritten (#${{ github.event.pull_request.number }})
path: src/**
- id: get_short_sha
if: ${{ github.event_name != 'pull_request' }}
name: Get abbreviated commit SHA
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- if: ${{ steps.get_short_sha.outcome == 'success' }}
name: Upload artifact (push, workflow_dispatch)
uses: actions/upload-artifact@v7
with:
name: XKit Rewritten (${{ github.ref_name }} ${{ steps.get_short_sha.outputs.SHORT_SHA }})
path: src/**
test:
name: Test
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js environment
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test