|
| 1 | +name: Build Without Go Proxy |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + types: [opened, synchronize, reopened] |
| 9 | + |
| 10 | +jobs: |
| 11 | + build-no-proxy: |
| 12 | + name: Build (${{ matrix.os }}/${{ matrix.arch }}) |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + include: |
| 17 | + - os: darwin |
| 18 | + arch: amd64 |
| 19 | + - os: darwin |
| 20 | + arch: arm64 |
| 21 | + - os: linux |
| 22 | + arch: "386" |
| 23 | + - os: linux |
| 24 | + arch: amd64 |
| 25 | + - os: linux |
| 26 | + arch: arm64 |
| 27 | + - os: windows |
| 28 | + arch: "386" |
| 29 | + - os: windows |
| 30 | + arch: amd64 |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout code |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Append python to mise.toml |
| 37 | + run: | |
| 38 | + echo "python = \"3.13.3\"" >> mise.toml |
| 39 | +
|
| 40 | + - name: Create default packages file |
| 41 | + run: | |
| 42 | + # Unlike the Python one below, this one can't be at |
| 43 | + # a configurable location, so we always write it to the home dir. |
| 44 | + cat <<EOF > ~/.default-go-packages |
| 45 | + golang.org/x/tools/cmd/goimports@latest |
| 46 | + EOF |
| 47 | +
|
| 48 | + echo "$HOME/go/bin" >> "$GITHUB_PATH" |
| 49 | +
|
| 50 | + cat <<EOF > .mise-python-default-packages |
| 51 | + pre-commit==1.21.0 |
| 52 | + cfgv==2.0.1 |
| 53 | + zipp==1.1.0 |
| 54 | + EOF |
| 55 | +
|
| 56 | + echo "MISE_PYTHON_DEFAULT_PACKAGES_FILE=.mise-python-default-packages" >> "$GITHUB_ENV" |
| 57 | +
|
| 58 | + - name: Use mise to install dependencies |
| 59 | + uses: jdx/mise-action@v2 |
| 60 | + with: |
| 61 | + version: 2025.4.4 |
| 62 | + env: |
| 63 | + # Adding token here to reduce the likelihood of hitting rate limit issues. |
| 64 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + |
| 66 | + - id: go-cache-paths |
| 67 | + run: | |
| 68 | + echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" |
| 69 | +
|
| 70 | + - name: Go Build Cache |
| 71 | + uses: actions/cache@v4 |
| 72 | + with: |
| 73 | + path: ${{ steps.go-cache-paths.outputs.go-build }} |
| 74 | + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-${{ matrix.arch }} |
| 75 | + |
| 76 | + - name: Run pre-commit hooks |
| 77 | + env: |
| 78 | + GOPROXY: direct |
| 79 | + GOOS: ${{ matrix.os }} |
| 80 | + GOARCH: ${{ matrix.arch }} |
| 81 | + run: | |
| 82 | + pre-commit install |
| 83 | + pre-commit run --all-files |
0 commit comments