Skip to content

Commit

Permalink
chore(ci): add unit test for golang and rust
Browse files Browse the repository at this point in the history
Signed-off-by: mlycore <[email protected]>
  • Loading branch information
mlycore committed Jun 2, 2022
1 parent 6b1fd6e commit 1138902
Showing 1 changed file with 8 additions and 49 deletions.
57 changes: 8 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
- release-*
push:
tags:
- "release-*"
- "v*"

jobs:
pisa-controller:
Expand All @@ -37,59 +37,18 @@ jobs:
go-version: '1.18.1'
- name: "unit test"
run: "cd pisa-controller && go test ./..."
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "##[set-output name=tags;]$(echo ${GITHUB_REF#refs/tags/})"
else
echo "##[set-output name=tags;]$(echo '')"
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
else
echo "##[set-output name=branch;]$(echo '')"
fi
- name: "Kaniko build"
uses: mlycore/action-kaniko@master
with:
image: pisanixio/controller
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
build_file: pisa-controller/hack/Dockerfile
tag_with_latest: true
extra_args: --build-arg GIT_BRANCH=${{ steps.vars.outputs.branch }} --build-arg GIT_COMMIT=${{ steps.vars.outputs.sha_short }} --build-arg GIT_TAG=${{ steps.vars.outputs.tags }}


pisa-proxy:
runs-on: ubuntu-latest
steps:
- name: "checkout codes"
uses: actions/checkout@v2
- name: Declare some variables
id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "##[set-output name=tags;]$(echo ${GITHUB_REF#refs/tags/})"
else
echo "##[set-output name=tags;]$(echo '')"
fi
if [[ $GITHUB_REF == refs/heads/* ]]; then
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
else
echo "##[set-output name=branch;]$(echo '')"
fi
- name: "Kaniko build"
uses: mlycore/action-kaniko@master
- name: "prepare rs toolchain"
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
image: pisanixio/proxy
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
build_file: pisa-proxy/hack/Dockerfile
tag_with_latest: true
extra_args: --build-arg GIT_BRANCH=${{ steps.vars.outputs.branch }} --build-arg GIT_COMMIT=${{ steps.vars.outputs.sha_short }} --build-arg GIT_TAG=${{ steps.vars.outputs.tags }}
command: test
args: --manifest-path pisa-proxy/Cargo.toml

0 comments on commit 1138902

Please sign in to comment.