Skip to content

✨ (go/v4) Add GitHub Actions #2

✨ (go/v4) Add GitHub Actions

✨ (go/v4) Add GitHub Actions #2

name: Test Sample CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GitHub CLI
run: sudo apt-get install gh -y
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'
- name: Prepare the environment
run: |
KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml"
sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH
sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH
cd testdata/project-v4/
go mod tidy
make generate
make manifests
- name: Lint
run: |
echo "Running lint ci"
cd testdata/project-v4/
gh workflow run .github/lint.yml
e2e_tests:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GitHub CLI
run: sudo apt-get install gh -y
- name: E2e Tests
run: |
echo "Running e2e tests ci"
cd testdata/project-v4/
gh workflow run .github/e2e-tests.yml
unit_tests:
runs-on: ubuntu-latest
needs: e2e_tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install GitHub CLI
run: sudo apt-get install gh -y
- name: Unit Tests
run: |
echo "Running unit tests ci"
cd testdata/project-v4/
gh workflow run .github/unit-tests.yml