ci: lowercase repository #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request_target: | ||
branches: | ||
- 'main' | ||
types: | ||
# Adding 'labeled' to the list of activity types that trigger this event | ||
# (default: opened, synchronize, reopened) so that we can run this | ||
# workflow when the 'ok-to-test' label is added. | ||
# Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
- opened | ||
- synchronize | ||
- reopened | ||
- labeled | ||
jobs: | ||
unit-test: | ||
name: Unit Test | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
path: src/github.com/containerd/accelerated-container-image | ||
fetch-depth: 100 | ||
- name: install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19' | ||
- name: set env | ||
shell: bash | ||
run: | | ||
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV | ||
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH | ||
- name: unit test | ||
working-directory: src/github.com/containerd/accelerated-container-image | ||
run: | | ||
sudo GO_TESTFLAGS=-v make test | ||
e2e-test: | ||
name: E2E Test | ||
if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') || github.event_name == 'push' }} | ||
steps: | ||
- name: lower repo | ||
shell: bash | ||
run: | | ||
GITHUB_REPOSITORY=${{ github.repository }} | ||
echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV | ||
- uses: ./.github/workflows/ci-e2e.yml | ||
with: | ||
commit-hash: ${{ github.event.pull_request.head.sha || github.sha }} | ||
image-tag: ${{ github.event.pull_request.number || 'default' }} | ||
github-repository: ${{ env.GITHUB_REPOSITORY }} | ||
secrets: inherit | ||
Check failure on line 64 in .github/workflows/ci.yml GitHub Actions / CIInvalid workflow file
|