github.com/goplus/llgo@v0.8.3/.github/workflows/go.yml (about) 1 # This workflow will build a golang project 2 # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go 3 4 name: Go 5 6 on: 7 push: 8 branches: [ "main" ] 9 pull_request: 10 branches: [ "main" ] 11 12 jobs: 13 14 test-macos: 15 runs-on: macos-latest 16 strategy: 17 matrix: 18 llvm: [17] 19 steps: 20 - uses: actions/checkout@v4 21 22 - name: Update Homebrew 23 if: matrix.llvm == 17 # needed as long as LLVM 17 is still fresh 24 run: brew update 25 - name: Install LLVM ${{ matrix.llvm }} 26 run: HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.llvm }} 27 28 - name: Set up Go 29 uses: actions/setup-go@v5 30 with: 31 go-version: '1.20' 32 33 - name: Build 34 run: go build -v ./... 35 36 - name: Test 37 run: go test -v ./... 38 39 test-linux: 40 runs-on: ubuntu-20.04 41 strategy: 42 matrix: 43 llvm: [17] 44 steps: 45 - uses: actions/checkout@v4 46 47 - name: Install LLVM ${{ matrix.llvm }} 48 run: | 49 echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main' | sudo tee /etc/apt/sources.list.d/llvm.list 50 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 51 sudo apt-get update 52 sudo apt-get install --no-install-recommends llvm-${{ matrix.llvm }}-dev 53 54 - name: Set up Go 55 uses: actions/setup-go@v5 56 with: 57 go-version: '1.20' 58 59 - name: Build 60 run: go build -v ./... 61 62 - name: Test 63 run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./... 64 65 - name: Upload coverage reports to Codecov 66 uses: codecov/codecov-action@v4 67 with: 68 token: ${{ secrets.CODECOV_TOKEN }} 69 slug: goplus/llgo