empty push #70
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: CI | |
on: | |
push: | |
branches: | |
- feature/entitlement-creation | |
tags: [v*] | |
paths-ignore: | |
- README.md | |
- CHANGELOG.md | |
- LICENSE | |
pull_request: | |
# Sequence of patterns matched against refs/heads | |
branches: | |
- feature/entitlement-creation | |
paths-ignore: | |
- README.md | |
- CHANGELOG.md | |
- LICENSE | |
env: | |
PROJECT: 'focal-freedom-236620' | |
IMAGE_NAME: 'operator' | |
GKE_CLUSTER: 'potctl-ci' | |
GKE_ZONE: 'us-central1-a' | |
controller_image: 'gcr.io/focal-freedom-236620/controller:3.0.4' | |
enterprise_image: 'gcr.io/focal-freedom-236620/enterprise-controller:master' | |
agent_image: 'gcr.io/focal-freedom-236620/agent:3.0.1' | |
operator_image: 'gcr.io/focal-freedom-236620/operator:develop' | |
kubelet_image: 'gcr.io/focal-freedom-236620/kubelet:develop' | |
port_manager_image: 'gcr.io/focal-freedom-236620/port-manager:develop' | |
router_image: 'gcr.io/focal-freedom-236620/router:develop' | |
router_arm_image: 'gcr.io/focal-freedom-236620/router-arm:develop' | |
proxy_image: 'gcr.io/focal-freedom-236620/proxy:3.0.0-beta1' | |
proxy_arm_image: 'gcr.io/focal-freedom-236620/proxy-arm:develop' | |
iofog_agent_version: '0.0.0-dev' | |
controller_version: '0.0.0-dev' | |
version: | |
agent_vm_list: | |
controller_vm: | |
jobs: | |
Build: | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
packages: 'write' | |
name: Build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
cache: false | |
- run: go version | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.50.1 | |
args: --timeout=5m0s | |
- name: Run bootstrap | |
run: PIPELINE=1 script/bootstrap.sh | |
- run: make test | |
- name: 'Get Previous tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@v1" | |
with: | |
fallback: v0.0.0 | |
- name: Set image tag | |
shell: bash | |
id: tags | |
run: | | |
if [[ ${{ github.ref_name }} =~ ^v.* ]] ; then | |
echo "VERSION=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}" | |
else | |
echo "VERSION=${{ steps.previoustag.outputs.tag }}-dev" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Get image tag | |
run: | | |
echo ${{ steps.tags.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.yml | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
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] | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
deployments: write | |
id-token: write | |
issues: write | |
discussions: write | |
packages: write | |
pages: write | |
pull-requests: write | |
repository-projects: write | |
security-events: write | |
statuses: write | |
name: Publish potctl Prod | |
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: ${{ env.GITHUB_REF_NAME }} | |
args: --rm-dist --debug --config ./.goreleaser-potctl.yml | |
env: | |
VERSION: ${{ needs.Build.outputs.VERSION }} | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- 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" | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: potctl | |
path: ${{ github.workspace }}/dist |