set min go version to 1.21 #52
Workflow file for this run
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
name: Tests | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
tests: | |
name: Test code | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: | |
- ^1.21 | |
- ^1.22 | |
- ^1.23 | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get install -y libacl1-dev | |
go install golang.org/x/lint/golint@latest | |
- name: Test | |
run: | | |
make test | |
golint ./... | |
- name: Build and run version | |
run: | | |
make VERSION=testing-version clean build | |
./build/grafsy -v | |
CGO_ENABLED=0 make GO_FLAGS='-tags noacl' VERSION=testing-version clean build | |
./build/grafsy -v | |
build: | |
name: Build packages | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ github.repository }}:builder | |
outputs: | |
deb: ${{ steps.build.outputs.deb }} | |
rpm: ${{ steps.build.outputs.rpm }} | |
sha256sum: ${{ steps.build.outputs.sha256sum }} | |
md5sum: ${{ steps.build.outputs.md5sum }} | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
- name: Build packages | |
id: build | |
run: | | |
git config --global user.email "you@example.com" | |
git config --global user.name "Your Name" | |
git tag -m 'Test build' v0.0.0.1 | |
make packages | |
make github_artifact | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: artifact | |
docker: | |
name: Build docker images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
- name: Build docker images | |
run: | | |
git config --global user.email "you@example.com" | |
git config --global user.name "Your Name" | |
git tag -m 'Test build' v0.0.0.1 | |
make docker | |
install: | |
needs: build | |
name: Install packages | |
runs-on: ubuntu-latest | |
container: | |
image: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- debian:11 | |
- debian:12 | |
- debian:13 | |
- ubuntu:20.04 | |
- ubuntu:22.04 | |
- ubuntu:24.04 | |
- centos:8 | |
- centos:9 | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: packages | |
- name: Test deb | |
if: ${{ contains(matrix.os, 'debian') || contains(matrix.os, 'ubuntu') }} | |
run: | | |
apt-get install libacl1; dpkg -i grafsy_0.0.0.1*deb | |
- name: Test rpm | |
if: ${{ contains(matrix.os, 'centos') }} | |
run: | | |
rpm -i grafsy-0.0.0.1*rpm |