-
-
Notifications
You must be signed in to change notification settings - Fork 140
73 lines (70 loc) · 1.97 KB
/
build.yml
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
name: Build
on:
push:
branches:
- 'master'
tags-ignore:
- '**' # prevent double build on release tag
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- '**'
# Global variables that will be load into every shell
env:
TEST_REPORT_ESLINT_FOLDER: reports/eslint
TEST_REPORT_ESLINT_FILENAME: eslint.json
jobs:
lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Run eslint checking
run: |
yarn eslint src *.js *.ts --report-unused-disable-directives --format json --output-file $REPORT_PATH
env:
REPORT_PATH: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/${{ env.TEST_REPORT_ESLINT_FILENAME }}
- name: Annotate lint result
if: always()
uses: ataylorme/eslint-annotate-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
report-json: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/${{ env.TEST_REPORT_ESLINT_FILENAME }}
only-pr-files: false
- name: Preserve lint report as artifact
uses: actions/upload-artifact@v3
with:
name: lint-report
path: ${{ env.TEST_REPORT_ESLINT_FOLDER }}/*
retention-days: ${{ env.DEFAULT_ARTIFACT_RETENTION_DAYS }}
build:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/setup
- name: Build
run: |
yarn build
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ runner.os }} # artifacts zip name
path: |
dist