Skip to content

Commit

Permalink
workflow updated
Browse files Browse the repository at this point in the history
  • Loading branch information
emirhandurmus committed Feb 19, 2024
1 parent fd0013a commit d1ccd78
Showing 1 changed file with 1 addition and 93 deletions.
94 changes: 1 addition & 93 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,101 +88,9 @@ jobs:
with:
name: potctl
path: ${{ github.workspace }}/dist
Test:
needs: Build
runs-on: ubuntu-20.04
permissions:
contents: 'read'
id-token: 'write'
packages: 'read'
steps:
- uses: actions/checkout@v3
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
- name: 'Pull develop ghcr docker image'
run: |
docker pull ${{ env.controller_image }}
docker pull ${{ env.agent_image }}
- uses: actions/download-artifact@v2
with:
name: potctl
- run: ls
- name: Prepare potctl binary
shell: bash
run: |
sudo cp ${{ github.workspace }}//build_linux_linux_amd64/potctl /usr/local/bin/
sudo cp ${{ github.workspace }}//build_linux_linux_amd64/potctl /usr/local/bin/
sudo chmod 0755 /usr/local/bin/potctl
- run: sudo apt-get install -y jq
- name: Verify potctl
run: |
which potctl
potctl version
- run: ./pipeline/steps/configure-env.sh
- name: Install test deps
shell: bash
run: |
git clone https://github.com/bats-core/bats-core.git && cd bats-core && git checkout tags/v1.1.0 && sudo ./install.sh /usr/local
sudo npm i -g tap-junit
- name: Run smoke test
run: test/run.bash smoke
- name: Run functional Test
shell: bash
run: |
set -o pipefail
test/run.bash local | tee test/conf/results-local.tap
- name: 'Convert test output from TAP to JUnit'
shell: bash
run: |
tap-junit -i test/conf/results-local.tap -o test/conf -s Local -n results-local.xml || true
Publish_potctl_Dev:
needs: [Build, Test]

runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
packages: 'write'
name: Publish potctl Dev
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.18'
cache: false
- name: Get image tag
run: |
echo ${{ needs.Build.outputs.VERSION }}
- name: potctl build packages GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: 1.1.0
args: --snapshot --rm-dist --debug --config ./.goreleaser-potctl-dev.yml
env:
VERSION: ${{ needs.Build.outputs.VERSION }}
- name: Install Packagecloud cli
run: go install github.com/edgeworx/packagecloud@v0.1.1
- run: ./.packagecloud-publish.sh
continue-on-error: true
env:
PACKAGECLOUD_TOKEN: ${{ secrets.packagecloud_token }}
PACKAGECLOUD_REPO: "datasance/potctl-snapshots"
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: potctl_dev
path: ${{ github.workspace }}/dist

Publish_potctl_Prod:
needs: [Build, Test]
needs: [Build]

runs-on: ubuntu-latest
permissions:
Expand Down

0 comments on commit d1ccd78

Please sign in to comment.