Merge pull request #4 from Andreagit97/update_readme #71
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: Build and test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-24.04 | |
steps: | |
# The composite action `Setup Environment` is local so we need to checkout before calling it | |
- name: Checkout commit | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
fetch-depth: 0 | |
- name: Setup Environment | |
uses: ./.github/actions/setup-env | |
- name: Build | |
run: | | |
go generate ./... | |
go build . | |
- name: Run tests | |
run: | | |
sudo -E env "PATH=$PATH" go test ./... -count=1 | |
upload_dev_artifacts: | |
needs: build_and_test | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout commit | |
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
with: | |
fetch-depth: 0 | |
- name: Setup Environment | |
uses: ./.github/actions/setup-env | |
# use goreleaser to build all supported archs | |
- name: Build all supported archs | |
id: run-goreleaser | |
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --snapshot --clean | |
- name: Archive x86_64 tar.gz | |
uses: actions/upload-artifact@v3 | |
with: | |
name: x86_64 | |
path: ./dist/bpftree_Linux_x86_64.tar.gz | |
- name: Archive arm64 tar.gz | |
uses: actions/upload-artifact@v3 | |
with: | |
name: arm64 | |
path: ./dist/bpftree_Linux_arm64.tar.gz | |
- name: Archive s390x tar.gz | |
uses: actions/upload-artifact@v3 | |
with: | |
name: s390x | |
path: ./dist/bpftree_Linux_s390x.tar.gz |