Merge pull request #1382 from kubean-io/dependabot/github_actions/doc… #925
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: 2. Main branch verify | |
on: | |
push: | |
branches: | |
- main | |
env: | |
ENVIRONMENT_RUNS_ON: self-hosted | |
ENVIRONMENT_CD: dev | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 1.22.4 | |
- name: unit test | |
run: | | |
make test > coverage.temp | |
grep total coverage.temp > coverage.txt | |
rm -rf coverage.temp | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov | |
call-images-build: | |
uses: ./.github/workflows/call-build-imgs.yaml | |
secrets: inherit | |
needs: unit-test | |
with: | |
CI_TYPE: main | |
get-environment: | |
runs-on: ubuntu-latest | |
needs: call-images-build | |
outputs: | |
environment_runs_on: ${{ steps.get_variables.outputs.environment_runs_on }} | |
enviroment_cd: ${{ steps.get_variables.outputs.enviroment_cd }} | |
steps: | |
- name: Get environment variable | |
id: get_variables | |
run: | | |
echo environment_runs_on=${{ env.ENVIRONMENT_RUNS_ON }} >> $GITHUB_OUTPUT | |
echo enviroment_cd=${{ env.ENVIRONMENT_CD }} >> $GITHUB_OUTPUT | |
call-cd: | |
uses: ./.github/workflows/call-cd.yaml | |
secrets: inherit | |
needs: get-environment | |
with: | |
ENVIRONMENT_RUNS_ON: ${{ needs.get-environment.outputs.environment_runs_on }} | |
ENRIRONMENT_CD: ${{ needs.get-environment.outputs.enviroment_cd }} | |
CI_TYPE: main |