Skip to content

Commit 875d33d

Browse files
ci: use actionlint and problem matchers
1 parent 4bac84e commit 875d33d

25 files changed

Lines changed: 201 additions & 118 deletions

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# ensure dockerfiles are checked out with LF line endings
1+
# ensure Linux specific files are checked out with LF line endings
22
Dockerfile text eol=lf
33
*.dockerfile text eol=lf
4-
5-
# ensure flatpak lint json files are checked out with LF line endings
64
*flatpak-lint-*.json text eol=lf
5+
*.sh text eol=lf

.github/matchers/copr-ci.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "copr-ci-gcc",
5+
"pattern": [
6+
{
7+
"regexp": "^/?(?:[^/]+/){5}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/matchers/docker.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "docker-gcc",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:#\\d+\\s+\\d+\\.\\d+\\s+)?/?(?:[^/]+/){2}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/matchers/gcc-strip3.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "gcc-strip3",
5+
"pattern": [
6+
{
7+
"regexp": "^/?(?:[^/]+/){3}([^:]+):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/matchers/gcc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "gcc",
5+
"pattern": [
6+
{
7+
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"severity": 4,
12+
"message": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/workflows/_common-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ concurrency:
2323
jobs:
2424
lint:
2525
name: Common Lint
26-
uses: LizardByte/.github/.github/workflows/__call-common-lint.yml@master
26+
uses: LizardByte/.github/.github/workflows/__call-common-lint.yml@feat/workflows/add-actionlint
2727
if: ${{ github.repository != 'LizardByte/.github' }}

.github/workflows/ci-copr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
required: false
1717
COPR_CLI_CONFIG:
1818
required: false
19+
GH_BOT_TOKEN:
20+
required: false
21+
VIRUSTOTAL_API_KEY:
22+
required: false
1923

2024
concurrency:
2125
group: "_${{ github.workflow }}-${{ github.ref }}"

.github/workflows/ci-flatpak.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,16 @@ jobs:
7373
cmake \
7474
flatpak
7575
76-
sudo su $(whoami) -c "flatpak --user remote-add --if-not-exists flathub \
77-
https://flathub.org/repo/flathub.flatpakrepo"
76+
sudo su "$(whoami)" -c "flatpak --user remote-add --if-not-exists flathub \
77+
https://flathub.org/repo/flathub.flatpakrepo
78+
"
7879
79-
sudo su $(whoami) -c "flatpak --user install -y flathub \
80+
sudo su "$(whoami)" -c "flatpak --user install -y flathub \
8081
org.flatpak.Builder \
8182
org.freedesktop.Platform/${{ matrix.arch }}/${PLATFORM_VERSION} \
8283
org.freedesktop.Sdk/${{ matrix.arch }}/${PLATFORM_VERSION} \
8384
org.freedesktop.Sdk.Extension.node${NODE_VERSION}/${{ matrix.arch }}/${PLATFORM_VERSION} \
84-
"
85+
"
8586
8687
flatpak run org.flatpak.Builder --version
8788
@@ -101,9 +102,11 @@ jobs:
101102
flatpak-${{ matrix.arch }}-
102103
103104
- name: Configure Flatpak Manifest
105+
env:
106+
BRANCH: ${{ github.head_ref }}
104107
run: |
105108
# variables for manifest
106-
branch="${{ github.head_ref }}"
109+
branch="${{ env.BRANCH }}"
107110
build_version=${{ inputs.release_version }}
108111
commit=${{ inputs.release_commit }}
109112
@@ -137,35 +140,37 @@ jobs:
137140
138141
- name: Debug Manifest
139142
working-directory: build
140-
run: cat ${APP_ID}.yml
143+
run: cat "${APP_ID}.yml"
141144

142145
- name: Build Linux Flatpak
143146
working-directory: build
144147
run: |
145-
sudo su $(whoami) -c "flatpak run org.flatpak.Builder \
148+
echo "::add-matcher::.github/matchers/gcc-strip3.json"
149+
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
146150
--arch=${{ matrix.arch }} \
147151
--force-clean \
148152
--repo=repo \
149153
--sandbox \
150154
--stop-at=cuda build-sunshine ${APP_ID}.yml"
151155
cp -r .flatpak-builder copy-of-flatpak-builder
152-
sudo su $(whoami) -c "flatpak run org.flatpak.Builder \
156+
sudo su "$(whoami)" -c "flatpak run org.flatpak.Builder \
153157
--arch=${{ matrix.arch }} \
154158
--force-clean \
155159
--repo=repo \
156160
--sandbox \
157161
build-sunshine ${APP_ID}.yml"
158162
rm -rf .flatpak-builder
159163
mv copy-of-flatpak-builder .flatpak-builder
160-
sudo su $(whoami) -c "flatpak build-bundle \
164+
sudo su "$(whoami)" -c "flatpak build-bundle \
161165
--arch=${{ matrix.arch }} \
162166
./repo \
163167
../artifacts/sunshine_${{ matrix.arch }}.flatpak ${APP_ID}"
164-
sudo su $(whoami) -c "flatpak build-bundle \
168+
sudo su "$(whoami)" -c "flatpak build-bundle \
165169
--runtime \
166170
--arch=${{ matrix.arch }} \
167171
./repo \
168172
../artifacts/sunshine_debug_${{ matrix.arch }}.flatpak ${APP_ID}.Debug"
173+
echo "::remove-matcher owner=gcc-strip3::"
169174
170175
- name: Lint Flatpak
171176
working-directory: build
@@ -177,7 +182,7 @@ jobs:
177182
--exceptions \
178183
--user-exceptions "${exceptions_file}" \
179184
manifest \
180-
${APP_ID}.yml
185+
"${APP_ID}.yml"
181186
182187
echo "Linting flatpak repo"
183188
# TODO: add arg
@@ -193,13 +198,13 @@ jobs:
193198
if: matrix.arch == 'x86_64'
194199
run: |
195200
mkdir -p flathub/modules
196-
cp ./build/generated-sources.json ./flathub/
197-
cp ./build/package-lock.json ./flathub/
198-
cp ./build/${APP_ID}.yml ./flathub/
199-
cp ./build/${APP_ID}.metainfo.xml ./flathub/
200-
cp ./packaging/linux/flatpak/README.md ./flathub/
201-
cp ./packaging/linux/flatpak/flathub.json ./flathub/
202-
cp -r ./packaging/linux/flatpak/modules/. ./flathub/modules/
201+
cp "./build/generated-sources.json" "./flathub/"
202+
cp "./build/package-lock.json" "./flathub/"
203+
cp "./build/${APP_ID}.yml" "./flathub/"
204+
cp "./build/${APP_ID}.metainfo.xml" "./flathub/"
205+
cp "./packaging/linux/flatpak/README.md" "./flathub/"
206+
cp "./packaging/linux/flatpak/flathub.json" "./flathub/"
207+
cp -r "./packaging/linux/flatpak/modules/." "./flathub/modules/"
203208
# submodules will need to be handled in the workflow that creates the PR
204209
205210
# create the archive

.github/workflows/ci-homebrew.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ jobs:
7373
brew install python3
7474
7575
- name: Configure formula
76+
env:
77+
HEAD_REF: ${{ github.head_ref }}
78+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
79+
PR_DEFAULT_BRANCH: ${{ github.event.pull_request.head.repo.default_branch }}
7680
run: |
7781
# variables for formula
78-
branch="${{ github.head_ref }}"
82+
branch="${{ env.HEAD_REF }}"
7983
build_version=${{ inputs.release_version }}
8084
commit=${{ inputs.release_commit }}
8185
@@ -96,9 +100,9 @@ jobs:
96100
else
97101
echo "This is a PR event"
98102
clone_url=${{ github.event.pull_request.head.repo.clone_url }}
99-
branch="${{ github.event.pull_request.head.ref }}"
100-
default_branch="${{ github.event.pull_request.head.repo.default_branch }}"
101-
tag="${{ github.event.pull_request.head.ref }}"
103+
branch="${{ env.PR_HEAD_REF }}"
104+
default_branch="${{ env.PR_DEFAULT_BRANCH }}"
105+
tag="${{ env.PR_HEAD_REF }}"
102106
fi
103107
echo "Branch: ${branch}"
104108
echo "Clone URL: ${clone_url}"
@@ -143,8 +147,9 @@ jobs:
143147
export DISPLAY=:1
144148
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
145149
146-
echo "DISPLAY=${DISPLAY}" >> $GITHUB_ENV
150+
echo "DISPLAY=${DISPLAY}" >> "${GITHUB_ENV}"
147151
152+
- run: echo "::add-matcher::.github/matchers/gcc-strip3.json"
148153
- name: Validate Homebrew Formula
149154
id: test
150155
if: matrix.release != true
@@ -156,6 +161,7 @@ jobs:
156161
publish: false
157162
token: ${{ secrets.GH_TOKEN }}
158163
validate: true
164+
- run: echo "::remove-matcher owner=gcc-strip3::"
159165

160166
- name: Setup python
161167
id: python

.github/workflows/ci-linux.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979
--enable-x11 \
8080
--enable-glx \
8181
--enable-wayland \
82-
--without-legacy # emgd, nvctrl, fglrx
83-
make -j $(nproc)
82+
--without-legacy
83+
make -j "$(nproc)"
8484
sudo make install
8585
cd .. && rm -rf libva-*
8686
@@ -91,19 +91,21 @@ jobs:
9191
COMMIT: ${{ inputs.release_commit }}
9292
run: |
9393
chmod +x ./scripts/linux_build.sh
94+
echo "::add-matcher::.github/matchers/gcc.json"
9495
./scripts/linux_build.sh \
9596
--publisher-name='${{ github.repository_owner }}' \
9697
--publisher-website='https://app.lizardbyte.dev' \
9798
--publisher-issue-url='https://app.lizardbyte.dev/support' \
9899
--skip-cleanup \
99100
--skip-package \
100101
--ubuntu-test-repo ${{ matrix.EXTRA_ARGS }}
102+
echo "::remove-matcher owner=gcc::"
101103
102104
- name: Set AppImage Version
103105
if: matrix.name == 'AppImage'
104106
run: |
105107
version=${{ inputs.release_version }}
106-
echo "VERSION=${version}" >> $GITHUB_ENV
108+
echo "VERSION=${version}" >> "${GITHUB_ENV}"
107109
108110
- name: Package Linux - AppImage
109111
if: matrix.name == 'AppImage'

0 commit comments

Comments
 (0)