Skip to content

squash! refactor GitHub workflows #8

squash! refactor GitHub workflows

squash! refactor GitHub workflows #8

Workflow file for this run

name: Build
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
shellcheck:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Differential ShellCheck
id: ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifact with ShellCheck defects in SARIF format
uses: actions/upload-artifact@v4
with:
name: Differential ShellCheck SARIF
path: ${{ steps.ShellCheck.outputs.sarif }}
build:
strategy:
fail-fast: false
matrix:
go:
- oldstable
- stable
- tip
runs-on: ubuntu-22.04
steps:
- name: Install Dependencies
run: |
sudo add-apt-repository ppa:cowsql/stable -y --no-update
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
autoconf \
automake \
libcowsql-dev \
libacl1-dev \
libcap-dev \
liblxc1 \
liblz4-dev \
libsqlite3-dev \
libudev-dev \
libuv1-dev \
lxc-dev \
make \
pkg-config
- name: Checkout
uses: actions/checkout@v4
- name: Install Go (${{ matrix.go != 'tip' && matrix.go || 'stable' }})
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go != 'tip' && matrix.go || 'stable' }}
- name: Install Go (tip)
if: matrix.go == 'tip'
run: |
go install golang.org/dl/gotip@latest
gotip download
~/sdk/gotip/bin/go version
echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
- name: Save Go env
id: go-env
run: go env >> $GITHUB_OUTPUT
- name: Check compatible min Go version
run: |
go mod tidy
- name: Download go dependencies
run: |
go mod download
- name: Run Incus build
run: |
make
- name: Upload artifact (bin)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.go }}-incus-bin
path: |
${{ steps.go-env.outputs.GOBIN }}/
- name: Upload artifact (src)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.go }}-incus-src
path: |
./