✨ (go/v4) Add GitHub Actions #13
Workflow file for this run
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: Test Sample CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
check-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install act in project bin | |
run: | | |
mkdir -p testdata/project-v4/bin | |
ACT_VERSION="v0.2.65" # Replace with the latest version | |
curl -Lo act.tgz https://github.com/nektos/act/releases/download/${ACT_VERSION}/act_Linux_x86_64.tar.gz | |
tar -C testdata/project-v4/bin -xzf act.tgz act | |
rm -f act.tgz | |
- name: Test act installation | |
run: | | |
echo "Testing act installation" | |
testdata/project-v4/bin/act --help | |
- 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/ | |
./bin/act -W .github/workflows/lint.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium | |
- name: Unit Tests | |
run: | | |
echo "Running unit tests ci" | |
cd /testdata/project-v4/ | |
./bin/act -W .github/workflows/test.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium | |
- name: E2e Tests | |
run: | | |
echo "Running e2e tests ci" | |
cd /testdata/project-v4/ | |
./bin/act -W .github/workflows/test-e2e.yml --default --container-architecture linux/amd64 --image nektos/act-environments-ubuntu:medium |