codeberg.org/go-pdf/fpdf@v0.11.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 TAGS: "-tags=ci" 14 COVERAGE: "-coverpkg=github.com/go-pdf/fpdf/..." 15 16 jobs: 17 18 build: 19 name: Build 20 strategy: 21 matrix: 22 go-version: [1.22.x, 1.21.x] 23 platform: [ubuntu-latest, macos-latest, windows-latest] 24 runs-on: ${{ matrix.platform }} 25 steps: 26 - name: Install Go 27 uses: actions/setup-go@v5 28 with: 29 go-version: ${{ matrix.go-version }} 30 31 - name: Cache-Go 32 uses: actions/cache@v4 33 with: 34 path: | 35 ~/go/pkg/mod # Module download cache 36 ~/.cache/go-build # Build cache (Linux) 37 ~/Library/Caches/go-build # Build cache (Mac) 38 '%LocalAppData%\go-build' # Build cache (Windows) 39 40 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 41 restore-keys: | 42 ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 43 44 - name: Checkout code 45 uses: actions/checkout@v4 46 with: 47 fetch-depth: 1 48 49 - name: Build-Linux-32b 50 if: matrix.platform == 'ubuntu-latest' 51 run: | 52 GOARCH=386 go install -v $TAGS ./... 53 - name: Build-Linux-64b 54 if: matrix.platform == 'ubuntu-latest' 55 run: | 56 GOARCH=amd64 go install -v $TAGS ./... 57 - name: Build-Windows 58 if: matrix.platform == 'windows-latest' 59 run: | 60 go install -v $TAGS ./... 61 - name: Build-Darwin 62 if: matrix.platform == 'macos-latest' 63 run: | 64 go install -v $TAGS ./... 65 - name: Test Linux 66 if: matrix.platform == 'ubuntu-latest' 67 run: | 68 go run ./ci/run-tests.go $TAGS -race $COVERAGE 69 - name: Test Windows 70 if: matrix.platform == 'windows-latest' 71 run: | 72 go test $TAGS ./... 73 - name: Test Darwin 74 if: matrix.platform == 'macos-latest' 75 run: | 76 go run ./ci/run-tests.go $TAGS 77 - name: static-check 78 uses: dominikh/staticcheck-action@v1 79 with: 80 install-go: false 81 cache-key: ${{ matrix.platform }} 82 version: "2023.1.6" 83 - name: Upload-Coverage 84 if: matrix.platform == 'ubuntu-latest' 85 uses: codecov/codecov-action@v3