-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (81 loc) · 3.23 KB
/
Copy pathci.yml
File metadata and controls
95 lines (81 loc) · 3.23 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["**"]
permissions: {}
jobs:
lint:
runs-on: ubuntu-latest
env:
# renovate: datasource=github-releases depName=koalaman/shellcheck
SHELLCHECK_VERSION: v0.11.0
SHELLCHECK_SHA256: 8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Download shellcheck
run: |
curl --fail --silent --show-error --location --output /tmp/shellcheck.tar.xz \
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
echo "${SHELLCHECK_SHA256} /tmp/shellcheck.tar.xz" | sha256sum -c -
tar --extract --xz --file /tmp/shellcheck.tar.xz --directory /tmp
shell: bash
- name: Shellcheck
run: find . -type f -name "*.sh" -print0 | xargs -0 "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck"
shell: bash
- name: Download actionlint
run: bash <(curl --fail --silent --show-error --location "https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash") # v1.7.12
shell: bash
- name: actionlint
# actionlint doesn't yet understand GitHub's "$/..." self-repository
# `uses:` syntax (https://github.com/rhysd/actionlint/issues/711),
# which we use below to resolve zizmor's self-repository findings.
# Remove this -ignore once actionlint adds support.
run: ./actionlint -color -ignore 'specifying action "\$/" in invalid format'
shell: bash
test-formatted:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run rubyfmt-action against a formatted fixture (expect success)
uses: $/
with:
paths: test/fixtures/formatted.rb
test-unformatted:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run rubyfmt-action against an unformatted fixture (expect failure)
id: rubyfmt
continue-on-error: true
uses: $/
with:
paths: test/fixtures/unformatted.rb
- name: Assert the action failed
if: steps.rubyfmt.outcome != 'failure'
env:
ACTUAL_OUTCOME: ${{ steps.rubyfmt.outcome }}
run: |
echo "::error::Expected rubyfmt-action to fail on an unformatted fixture, but it reported '${ACTUAL_OUTCOME}'"
exit 1
test-macos:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run rubyfmt-action against a formatted fixture (expect success)
uses: $/
with:
paths: test/fixtures/formatted.rb