fix: check dir is exists before create/clone on world cardinal create… #649
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 | |
on: | |
pull_request: | |
types: [opened, synchronize, edited, reopened] | |
push: | |
branches: | |
- main | |
workflow_call: | |
env: | |
GO_VERSION: 1.21.1 | |
jobs: | |
test-unit-coverage: | |
name: Unit & Coverage | |
runs-on: namespace-profile-linux-4vcpu-8gb-cached | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
## skip cache, use Namespace volume cache | |
cache: false | |
- name: Init Dummy Git config for testing | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "github-action" | |
- name: Setup Namespace cache | |
uses: namespacelabs/nscloud-cache-action@v1 | |
with: | |
cache: go | |
- name: Run unit tests with coverage | |
shell: 'script -q -e -c "bash {0}"' | |
run: make test-coverage | |
- name: Upload coverage to Codecov | |
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request' | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
fail_ci_if_error: true | |
directory: "./" |