ci: don't use force-fallback
for snapcraft remote-build
#40
This file contains hidden or 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
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
tags: | |
- "!**" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
binaries: | |
name: Build concierge | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Run tests | |
run: | | |
go test -v ./... | |
- name: Setup goreleaser | |
run: | | |
sudo snap install --classic goreleaser | |
- name: Build concierge | |
id: build | |
run: | | |
goreleaser build --snapshot --clean | |
cp dist/concierge_linux_amd64_v1/concierge . | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload binary artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: binary | |
path: ./concierge | |
define-matrix: | |
name: Define spread matrix | |
runs-on: ubuntu-24.04 | |
outputs: | |
suites: ${{ steps.suites.outputs.suites }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
- name: Install | |
run: | | |
go install github.com/snapcore/spread/cmd/spread@latest | |
- name: Generate matrix list | |
id: suites | |
run: | | |
list="$(spread -list github-ci | sed "s|github-ci:ubuntu-24.04:tests/||g" | jq -r -ncR '[inputs | select(length>0)]')" | |
echo "suites=$list" | |
echo "suites=$list" >> $GITHUB_OUTPUT | |
spread-test: | |
name: Spread (${{ matrix.suite }}) | |
runs-on: ubuntu-24.04 | |
needs: | |
- binaries | |
- define-matrix | |
strategy: | |
matrix: | |
suite: ${{ fromJSON(needs.define-matrix.outputs.suites) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download binary artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: binary | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Install | |
run: | | |
go install github.com/snapcore/spread/cmd/spread@latest | |
- name: Run integration tests | |
run: | | |
spread -v "github-ci:ubuntu-24.04:tests/${{ matrix.suite }}" | |
snap: | |
name: Build snap | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup LXD | |
uses: canonical/setup-lxd@main | |
- name: Setup Snapcraft | |
run: | | |
sudo snap install snapcraft --classic | |
- name: Build snap | |
run: | | |
snapcraft --verbose |