Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# test 2
name: CI
permissions: read-all
on:
- push
- pull_request
pull_request_target:
branches: ["jiechen3/github_runner"]

env:
GO_BUILD_CMD: 'go build "-ldflags=-s -w" -trimpath'
Expand All @@ -19,8 +21,25 @@ env:
LINUX_BOOT_FILES_PATH: ${{ github.workspace }}/LinuxBootFiles

jobs:
check-access:
runs-on:
- ubuntu-latest
steps:
- name: Check access
run: |
if [[ "${{ github.event.pull_request.author_association }}" != "COLLABORATOR" && \
"${{ github.event.pull_request.author_association }}" != "CONTRIBUTOR" && \
"${{ github.event.pull_request.author_association }}" != "OWNER" ]]; then
echo "Author association: ${{ github.event.pull_request.author_association }}"
echo "Event not triggered by a collaborator/contributor/owner. Will not continue CI."
else
echo "Author is a ${{ github.event.pull_request.author_association }}. Continuing CI."
exit 1
fi

lint:
runs-on: "windows-2022"
needs: [check-access]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -57,6 +76,8 @@ jobs:
protos:
runs-on: "windows-2022"

needs: [check-access]

env:
# translating from github.com/Microsoft/hcsshim/<path> (via `go list`) to <path> is easier if hcsshim is in GOPATH/src
GOPATH: '${{ github.workspace }}\go'
Expand Down Expand Up @@ -118,6 +139,7 @@ jobs:
working-directory: "${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim"

verify-vendor:
needs: [check-access]
runs-on: "windows-2022"
env:
GOPROXY: "https://proxy.golang.org,direct"
Expand Down Expand Up @@ -185,6 +207,7 @@ jobs:

go-gen:
name: Go Generate
needs: [check-access]
runs-on: "windows-2022"
steps:
- name: Checkout
Expand Down Expand Up @@ -242,6 +265,7 @@ jobs:
# create the rootfs containing the local Linux-GCS. It needs to be run on
# the 1ES github runner pool in order to access the Azure Artifact feed.
create-linux-boot-files:
needs: [check-access]
runs-on:
- self-hosted
- 1ES.Pool=containerplat-github-runner-pool-east-us-2
Expand Down
Loading