-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (59 loc) · 1.73 KB
/
main.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
name: main
on:
workflow_dispatch:
inputs:
debug:
type: boolean
description: "Run the build with tmate debugging enabled"
required: false
default: false
ref:
type: string
description: "Checkout specific ref for the workflow"
required: false
pull_request:
branches:
- main
- release-*
# cache only shares from the same branch, we need to trigger an extra flow on pushing
# thus all PRs will share the cache from main/release-* branches
push:
branches:
- main
- release-*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
newline:
if: ${{ github.event_name != 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
depth: 1
- name: Check newline
uses: fernandrone/linelint@master
eslint:
if: ${{ github.event_name != 'push' }}
uses: ./.github/workflows/common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug != 'false' }}
ref: ${{ inputs.ref || github.ref }}
target: 'eslint'
build:
needs: [newline, eslint]
if: ${{ github.event_name != 'push' }}
uses: ./.github/workflows/common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug != 'false' }}
ref: ${{ inputs.ref || github.ref }}
target: 'build'
cache:
if: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/common.yml
with:
debug: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug != 'false' }}
ref: ${{ inputs.ref || github.ref }}
target: 'cache'