-
Notifications
You must be signed in to change notification settings - Fork 31
108 lines (91 loc) · 3.46 KB
/
Copy pathci.yml
File metadata and controls
108 lines (91 loc) · 3.46 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
name: 🔂 Continuous Integration
on:
push:
branches: [main, ci/*, dependabot/*, renovate/*]
tags:
- "v*.*.*"
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pre:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip == 'true' || (github.event_name == 'push' && contains(github.event.head_commit.message, '[ci-skip]')) }}
steps:
- name: Skip check
id: skip_check
uses: step-security/skip-duplicate-actions@4eef6ae57f2ca5ea100e5c1da2ead9138483f53c # v5
with:
concurrent_skipping: "never"
skip_after_successful_duplicate: "true"
paths_ignore: '["**/*.md", "**/.vscode/**", "**/.idea/**"]'
paths: '["**/**.fish", "tests/_resources/**", ".github/workflows/ci.yaml", "mise.toml"]'
tests:
name: 🔬 ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: pre
if: github.ref_type == 'tag' || needs.pre.outputs.should_skip != 'true'
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Setup mise
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4
with:
cache: true
log_level: debug
- name: Install fish shell
uses: fish-shop/install-fish-shell@e83b4f8c7c4d80c3b65ee0eb5d0e3bf4816536ee # v2
- name: Install abbreviation-tips with fisher
uses: fish-shop/install-plugin@1ca93fe158b1ad8251835d4e310f99a3ec1f3d86 # v2
with:
plugin-manager: fisher
plugins: ${{ github.event.pull_request.head.repo.full_name || github.repository }}@${{ github.head_ref || github.ref_name }}
- name: Run Fishtape tests
uses: fish-shop/run-fishtape-tests@d3f44af7c30393801362c283c97fbd753ded76ed # v2
with:
patterns: tests/**.fish
# timeout in case tests get stuck on fzf
timeout-minutes: 3
lint:
name: ✨ Lint
runs-on: ubuntu-latest
needs: pre
if: github.ref_type == 'tag' || needs.pre.outputs.should_skip != 'true'
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Setup mise
uses: jdx/mise-action@dba19683ed58901619b14f395a24841710cb4925 # v4
with:
cache: true
log_level: debug
- name: Install fish shell
uses: fish-shop/install-fish-shell@e83b4f8c7c4d80c3b65ee0eb5d0e3bf4816536ee # v2
- name: Run linting
run: mise run lint
# Ensure the workflow is successful only if all job in matrixes are successful
result:
name: ✅ Result
if: (github.ref_type == 'tag' || needs.pre.outputs.should_skip != 'true') && always()
runs-on: ubuntu-latest
needs:
- pre
- tests
- lint
steps:
- name: Mark workflow as failed if lint or tests did not pass or were cancelled
if: contains(fromJson('["failure", "cancelled"]'), needs.tests.result) || contains(fromJson('["failure", "cancelled"]'), needs.lint.result)
run: exit 1
- name: Invoke release workflow
if: github.ref_type == 'tag'
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1
with:
workflow: 🚀 Continuous Deployment