go-hep.org/x/hep@v0.38.1/.github/workflows/ci.yml (about) 1 name: CI 2 3 on: 4 push: 5 branches: [ main ] 6 pull_request: 7 branches: [ main ] 8 schedule: 9 - cron: '0 2 * * 1-5' 10 11 env: 12 GOPROXY: "https://proxy.golang.org" 13 ROOT_VERSION: "6.36.02" 14 TAGS: "-tags=ci" 15 COVERAGE: "-coverpkg=go-hep.org/x/hep/..." 16 EGL_PLATFORM: "x11" 17 18 jobs: 19 20 build: 21 name: Build 22 strategy: 23 matrix: 24 go-version: [1.25.x, 1.24.x] 25 platform: [ubuntu-latest, macos-latest, windows-latest] 26 runs-on: ${{ matrix.platform }} 27 steps: 28 - name: Install Go 29 uses: actions/setup-go@v5 30 with: 31 go-version: ${{ matrix.go-version }} 32 cache: true 33 34 - name: Cache-ROOT 35 uses: actions/cache@v4 36 with: 37 path: ~/root-${{ env.ROOT_VERSION }} 38 key: ${{ runner.os }}-root-${{ env.ROOT_VERSION }} 39 restore-keys: | 40 ${{ runner.os }}-root-${{ env.ROOT_VERSION }} 41 42 - name: Setup Git for Windows 43 run: | 44 git config --global core.autocrlf false 45 git config --global core.eol lf 46 47 - name: Checkout code 48 uses: actions/checkout@v4 49 with: 50 fetch-depth: 1 51 52 - name: Install Linux packages 53 if: matrix.platform == 'ubuntu-latest' 54 run: | 55 sudo apt-get update 56 go run ./ci/install-cxx-root.go -root-version=${ROOT_VERSION} -o=${HOME} 57 source $HOME/root-${ROOT_VERSION}/bin/thisroot.sh 58 root.exe --version 59 60 - name: Build-Linux-32b 61 if: matrix.platform == 'ubuntu-latest' 62 run: | 63 GOARCH=386 go install -v $TAGS,cross_compile ./... 64 - name: Build-Linux-64b 65 if: matrix.platform == 'ubuntu-latest' 66 run: | 67 source $HOME/root-${ROOT_VERSION}/bin/thisroot.sh 68 root.exe --version 69 GOARCH=amd64 go install -v $TAGS ./... 70 - name: Build-Windows 71 if: matrix.platform == 'windows-latest' 72 run: | 73 go install -v $TAGS ./... 74 - name: Build-Darwin 75 if: matrix.platform == 'macos-latest' 76 run: | 77 go install -v $TAGS ./... 78 - name: Test Linux 79 if: matrix.platform == 'ubuntu-latest' 80 run: | 81 source $HOME/root-${ROOT_VERSION}/bin/thisroot.sh 82 root.exe --version 83 go run ./ci/run-tests.go $TAGS -race $COVERAGE 84 go vet $TAGS ./... 85 - name: Test Windows 86 if: matrix.platform == 'windows-latest' 87 run: | 88 go run ./ci/run-tests.go $TAGS 89 go vet $TAGS ./... 90 - name: Test Darwin 91 if: matrix.platform == 'macos-latest' 92 run: | 93 go run ./ci/run-tests.go $TAGS 94 go vet $TAGS ./... 95 - name: static-check 96 uses: dominikh/staticcheck-action@v1 97 with: 98 install-go: false 99 cache-key: ${{ matrix.platform }} 100 version: "2025.1" 101 - name: Upload-Coverage 102 if: matrix.platform == 'ubuntu-latest' 103 uses: codecov/codecov-action@v3