Skip to content

CI

CI #2186

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * 1-5'
env:
GOPROXY: "https://proxy.golang.org"
ROOT_VERSION: "6.32.00"
TAGS: "-tags=ci"
COVERAGE: "-coverpkg=go-hep.org/x/hep/..."
EGL_PLATFORM: "x11"
jobs:
build:
name: Build
strategy:
matrix:
go-version: [1.23.x, 1.22.x]
platform: [ubuntu-20.04, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Cache-ROOT
uses: actions/cache@v4
with:
path: ~/root-${{ env.ROOT_VERSION }}
key: ${{ runner.os }}-root-${{ env.ROOT_VERSION }}
restore-keys: |
${{ runner.os }}-root-${{ env.ROOT_VERSION }}
- name: Setup Git for Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Linux packages
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -qq gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev xvfb xdotool
go run ./ci/install-cxx-root.go -root-version=${ROOT_VERSION} -o=${HOME}
source $HOME/root-${ROOT_VERSION}/bin/thisroot.sh
root.exe --version
- name: Build-Linux-32b
if: matrix.platform == 'ubuntu-20.04'
run: |
GOARCH=386 go install -v $TAGS,cross_compile ./...
- name: Build-Linux-64b
if: matrix.platform == 'ubuntu-20.04'
run: |
GOARCH=amd64 go install -v $TAGS ./...
- name: Build-Windows
if: matrix.platform == 'windows-latest'
run: |
go install -v $TAGS ./...
- name: Build-Darwin
if: matrix.platform == 'macos-latest'
run: |
go install -v $TAGS ./...
- name: Test Linux
if: matrix.platform == 'ubuntu-20.04'
run: |
go run ./ci/run-tests.go $TAGS -race $COVERAGE
go vet $TAGS ./...
- name: Test Windows
if: matrix.platform == 'windows-latest'
run: |
go run ./ci/run-tests.go $TAGS
go vet $TAGS ./...
- name: Test Darwin
if: matrix.platform == 'macos-latest'
run: |
go run ./ci/run-tests.go $TAGS
go vet $TAGS ./...
- name: static-check
uses: dominikh/staticcheck-action@v1
with:
install-go: false
cache-key: ${{ matrix.platform }}
version: "2024.1.1"
- name: Upload-Coverage
if: matrix.platform == 'ubuntu-20.04'
uses: codecov/codecov-action@v3