Skip to content

Migrate python handler to OIDCRegistry #240

Migrate python handler to OIDCRegistry

Migrate python handler to OIDCRegistry #240

Workflow file for this run

name: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
permissions: {}
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Test
run: script/test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
# yamllint is pre-installed on GitHub Actions runners:
# https://github.com/adrienverge/yamllint/pull/588
- run: yamllint .
- run: go mod tidy -diff
- name: Ensure gofmt passes
run: |
UNFORMATTED=$(gofmt -l . | grep -v '^vendor/' || true) # gofmt doesn't ignore the `vendor` folder
if [ -n "$UNFORMATTED" ]; then
echo "$UNFORMATTED" | xargs gofmt -d
exit 1
fi
- run: go build ./... # gives better error messages then go vet when the build fails, and go vet will reuse the build cache
- run: go vet ./...
# The `github/codeql-action/start-proxy` action uses native binaries for
# Linux, macOS, and Windows.
build-codeql:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
- name: Build
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
go build -o dependabot-proxy.exe .
else
go build -o dependabot-proxy .
fi
env:
CGO_ENABLED: 0
- name: Set output name
id: platform
shell: bash
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
echo "name=linux64" >> $GITHUB_OUTPUT;
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
echo "name=osx64" >> $GITHUB_OUTPUT;
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then
echo "name=win64" >> $GITHUB_OUTPUT;
fi
- name: Compress binary artifact
shell: bash
env:
PLATFORM_NAME: ${{ steps.platform.outputs.name }}
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
tar -czvf dependabot-proxy-win64.tar.gz dependabot-proxy.exe;
else
tar -czvf "dependabot-proxy-${PLATFORM_NAME}.tar.gz" dependabot-proxy;
fi
- name: Upload binary artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
path: dependabot-proxy-${{ steps.platform.outputs.name }}.tar.gz
name: dependabot-proxy-${{ steps.platform.outputs.name }}