forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
comment out everything but static checks
- Loading branch information
Showing
4 changed files
with
456 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
snap-name: | ||
description: Name of the snap to install | ||
required: true | ||
type: string | ||
snap-channel: | ||
description: Name of the channel to use (mutually exclusive with revision) | ||
default: latest/stable | ||
type: string | ||
snaps-dir: | ||
description: Directory where snaps should be stored | ||
default: snaps | ||
type: string | ||
snap-classic-confinement: | ||
description: Use classic confinement | ||
type: boolean | ||
default: false | ||
outputs: | ||
snap-revision: | ||
description: Revision of the installed snap | ||
value: ${{ steps.download.outputs.snap-revision }} | ||
type: string | ||
|
||
jobs: | ||
install-snap: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download snap ${{ inputs.snap-name }} from the Snap Store | ||
id: download | ||
uses: ./.github/actions/download-snap | ||
with: | ||
snap-name: ${{ inputs.snap-name }} | ||
snap-channel: ${{ inputs.snap-channel }} | ||
snaps-dir: ${{ inputs.snaps-dir }} | ||
- name: Install downloaded snap ${{ inputs.snap-name }} | ||
uses: ./.github/actions/install-offline-snap | ||
with: | ||
snap-name: ${{ inputs.snap-name }} | ||
snap-revision: ${{ steps.download.outputs.snap-revision }} | ||
snap-classic-confinement: ${{ inputs.snap-classic-confinement }} | ||
offline-snaps-dir: ${{ steps.download.outputs.offline-snaps-dir }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,86 +35,106 @@ jobs: | |
run: | | ||
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} | ||
- name: Download and install Debian dependencies | ||
# Github does not allow variables in "uses"; this has to be a hard-coded path | ||
uses: ./.github/actions/download-install-debian-deps | ||
with: | ||
snapd-src-dir: "${{ github.workspace }}" | ||
# - name: Download and install Debian dependencies | ||
# # Github does not allow variables in "uses"; this has to be a hard-coded path | ||
# uses: ./.github/actions/download-install-debian-deps | ||
# with: | ||
# snapd-src-dir: "${{ github.workspace }}" | ||
|
||
# golang latest ensures things work on the edge | ||
- name: Install the go snap | ||
run: | | ||
sudo snap install --classic --channel=${{ inputs.gochannel }} go | ||
install-go: | ||
uses: ./.github/workflows/install-snap.yaml | ||
with: | ||
snap-name: go | ||
snap-channel: ${{ inputs.gochannel }} | ||
snaps-dir: /tmp/tmp-snap-dir | ||
snap-classic-confinement: true | ||
|
||
- name: Install ShellCheck as a snap | ||
run: | | ||
sudo apt-get remove --purge shellcheck | ||
sudo snap install shellcheck | ||
install-shellcheck: | ||
uses: ./.github/workflows/install-snap.yaml | ||
with: | ||
snap-name: shellcheck | ||
snap-channel: latest/stable | ||
snaps-dir: /tmp/tmp-snap-dir | ||
|
||
- name: Get C vendoring | ||
run: | | ||
cd c-vendor && ./vendor.sh | ||
# - name: Remove shellcheck | ||
# run: sudo apt-get remove --purge shellcheck | ||
|
||
- name: Install golangci-lint snap | ||
run: | | ||
sudo snap install --classic golangci-lint | ||
# - name: Install ShellCheck as a snap | ||
# uses: ./.github/actions/install-snap | ||
# with: | ||
# snap-name: shellcheck | ||
# snap-channel: latest/stable | ||
# snaps-dir: /tmp/tmp-snap-dir | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/[email protected] | ||
with: | ||
path: ./ | ||
# - name: Get C vendoring | ||
# run: | | ||
# cd c-vendor && ./vendor.sh | ||
|
||
- name: Save changes files | ||
run: | | ||
CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}" | ||
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV | ||
echo "The changed files found are: $CHANGED_FILES" | ||
# - name: Install golangci-lint snap | ||
# uses: ./.github/actions/install-snap | ||
# with: | ||
# snap-name: golangci-lint | ||
# snap-channel: latest/stable | ||
# snaps-dir: /tmp/tmp-snap-dir | ||
# snap-classic-confinement: true | ||
|
||
- name: Run static checks | ||
run: | | ||
# run gofmt checks only with the latest stable Go | ||
if [ "${{ matrix.gochannel }}" != "latest/stable" ]; then | ||
export SKIP_GOFMT=1 | ||
echo "Formatting checks will be skipped due to the use of Go version ${{ inputs.gochannel }}" | ||
fi | ||
sudo apt-get install -y python3-yamlordereddictloader | ||
./run-checks --static | ||
- name: Cache prebuilt indent | ||
id: cache-indent-bin | ||
uses: actions/cache@v4 | ||
with: | ||
path: indent-bin | ||
key: ${{ runner.os }}-indent-2.2.13 | ||
# - name: Get changed files | ||
# id: changed-files | ||
# uses: tj-actions/[email protected] | ||
# with: | ||
# path: ./ | ||
|
||
# build indent 2.2.13 which has this patch | ||
# https://git.savannah.gnu.org/cgit/indent.git/commit/?id=22b83d68e9a8b429590f42920e9f473a236123cf | ||
- name: Build indent 2.2.13 | ||
if: steps.cache-indent-bin.outputs.cache-hit != 'true' | ||
run: | | ||
sudo apt install texinfo autopoint | ||
curl -O https://ftp.gnu.org/gnu/indent/indent-2.2.13.tar.xz | ||
tar xvf indent-2.2.13.tar.xz | ||
cd indent-2.2.13 | ||
autoreconf -if | ||
# set prefix in case we want to pack to tar/extract into system | ||
./configure --prefix=/opt/indent | ||
make -j | ||
make install DESTDIR=${{ github.workspace }}/indent-bin | ||
find ${{ github.workspace }}/indent-bin -ls | ||
- name: Check C source code formatting | ||
run: | | ||
set -x | ||
cd cmd/ | ||
./autogen.sh | ||
# apply formatting | ||
PATH=${{ github.workspace }}/indent-bin/opt/indent/bin:$PATH make fmt | ||
set +x | ||
if [ -n "$(git diff --stat)" ]; then | ||
git diff | ||
echo "C files are not fomratted correctly, run 'make fmt'" | ||
echo "make sure to have clang-format and indent 2.2.13+ installed" | ||
exit 1 | ||
fi | ||
# - name: Save changes files | ||
# run: | | ||
# CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}" | ||
# echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV | ||
# echo "The changed files found are: $CHANGED_FILES" | ||
|
||
# - name: Run static checks | ||
# run: | | ||
# # run gofmt checks only with the latest stable Go | ||
# if [ "${{ matrix.gochannel }}" != "latest/stable" ]; then | ||
# export SKIP_GOFMT=1 | ||
# echo "Formatting checks will be skipped due to the use of Go version ${{ inputs.gochannel }}" | ||
# fi | ||
# sudo apt-get install -y python3-yamlordereddictloader | ||
# ./run-checks --static | ||
|
||
# - name: Cache prebuilt indent | ||
# id: cache-indent-bin | ||
# uses: actions/cache@v4 | ||
# with: | ||
# path: indent-bin | ||
# key: ${{ runner.os }}-indent-2.2.13 | ||
|
||
# # build indent 2.2.13 which has this patch | ||
# # https://git.savannah.gnu.org/cgit/indent.git/commit/?id=22b83d68e9a8b429590f42920e9f473a236123cf | ||
# - name: Build indent 2.2.13 | ||
# if: steps.cache-indent-bin.outputs.cache-hit != 'true' | ||
# run: | | ||
# sudo apt install texinfo autopoint | ||
# curl -O https://ftp.gnu.org/gnu/indent/indent-2.2.13.tar.xz | ||
# tar xvf indent-2.2.13.tar.xz | ||
# cd indent-2.2.13 | ||
# autoreconf -if | ||
# # set prefix in case we want to pack to tar/extract into system | ||
# ./configure --prefix=/opt/indent | ||
# make -j | ||
# make install DESTDIR=${{ github.workspace }}/indent-bin | ||
# find ${{ github.workspace }}/indent-bin -ls | ||
|
||
# - name: Check C source code formatting | ||
# run: | | ||
# set -x | ||
# cd cmd/ | ||
# ./autogen.sh | ||
# # apply formatting | ||
# PATH=${{ github.workspace }}/indent-bin/opt/indent/bin:$PATH make fmt | ||
# set +x | ||
# if [ -n "$(git diff --stat)" ]; then | ||
# git diff | ||
# echo "C files are not fomratted correctly, run 'make fmt'" | ||
# echo "make sure to have clang-format and indent 2.2.13+ installed" | ||
# exit 1 | ||
# fi |
Oops, something went wrong.