|
| 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 | + precommit: |
| 12 | + name: Run pre-commit hooks |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout code |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Append python to mise.toml |
| 20 | + run: | |
| 21 | + echo "python = \"3.13.3\"" >> mise.toml |
| 22 | +
|
| 23 | + - name: Create default packages file |
| 24 | + run: | |
| 25 | + # Unlike the Python one below, this one can't be at |
| 26 | + # a configurable location, so we always write it to the home dir. |
| 27 | + cat <<EOF > ~/.default-go-packages |
| 28 | + golang.org/x/tools/cmd/goimports@latest |
| 29 | + EOF |
| 30 | +
|
| 31 | + echo "$HOME/go/bin" >> "$GITHUB_PATH" |
| 32 | +
|
| 33 | + cat <<EOF > .mise-python-default-packages |
| 34 | + pre-commit==1.21.0 |
| 35 | + cfgv==2.0.1 |
| 36 | + zipp==1.1.0 |
| 37 | + EOF |
| 38 | +
|
| 39 | + echo "MISE_PYTHON_DEFAULT_PACKAGES_FILE=.mise-python-default-packages" >> "$GITHUB_ENV" |
| 40 | +
|
| 41 | + - name: Use mise to install dependencies |
| 42 | + uses: jdx/mise-action@v2 |
| 43 | + with: |
| 44 | + version: 2025.4.4 |
| 45 | + env: |
| 46 | + # Adding token here to reduce the likelihood of hitting rate limit issues. |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + |
| 49 | + - id: go-cache-paths |
| 50 | + run: | |
| 51 | + echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" |
| 52 | +
|
| 53 | + - name: Go Build Cache |
| 54 | + uses: actions/cache@v4 |
| 55 | + with: |
| 56 | + path: ${{ steps.go-cache-paths.outputs.go-build }} |
| 57 | + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}-${{ matrix.os }}-${{ matrix.arch }} |
| 58 | + |
| 59 | + - name: Run pre-commit hooks |
| 60 | + env: |
| 61 | + GOPROXY: direct |
| 62 | + GOOS: ${{ matrix.os }} |
| 63 | + GOARCH: ${{ matrix.arch }} |
| 64 | + run: | |
| 65 | + pre-commit install |
| 66 | + pre-commit run --all-files |
0 commit comments