Skip to content

refactor: drop websockets and poll instead #2997

refactor: drop websockets and poll instead

refactor: drop websockets and poll instead #2997

Workflow file for this run

name: build
on:
push:
branches:
- master
tags:
- 'v*.*.*'
pull_request:
branches:
- '*'
jobs:
build:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Check no diff
run: make check-no-diff
- name: Lint check
run: |
make lint
helm lint ./charts/otfd
helm lint ./charts/otf-agent
helm template ./charts/otfd > /dev/null
helm template ./charts/otf-agent --set token=my_agent_token --set url=https://otf.ninja > /dev/null
- name: Vet check
run: make vet
- name: Add hosts to /etc/hosts
run: |
# API tests create webhooks on github.com, and github.com mandates
# that the webhook endpoint cannot be 'localhost', so we create a host
# entry to dupe github
sudo echo "127.0.0.1 otf.local" | sudo tee -a /etc/hosts
- name: API tests
run: make go-tfe-tests
env:
# go-tfe tests require a valid github oauth token be set with which
# to create a webhook on a github repo
OAUTH_CLIENT_GITHUB_TOKEN: ${{ secrets.GO_TFE_OAUTH_CLIENT_GITHUB_TOKEN }}
GITHUB_POLICY_SET_IDENTIFIER: leg100/go-tfe-webhooks
- name: Install e2e dependencies
run: make install-playwright-ubuntu
- name: Install tofu for provider mirror setup
uses: opentofu/setup-opentofu@v1
- name: Install terraform for provider mirror setup
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Setup provider mirror for e2e tests
run: ./hack/setup_mirror.sh
- name: Tests
env:
GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }}
run: make test
- name: Archive browser traces
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-browser-traces
path: internal/integration/traces
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0
version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: go
command: manifest
release:
runs-on: ubuntu-latest
needs: [build, release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: docker/login-action@v2
with:
username: leg100
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- uses: docker/setup-qemu-action@v2
- uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --skip=sign,validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
charts:
# only upgrade charts for new releases
needs: [release-please,release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bump version
run: |
# set app version on all charts
yq -i ".appVersion = \"${{ needs.release-please.outputs.version }}\"" ./charts/otfd/Chart.yaml
yq -i ".appVersion = \"${{ needs.release-please.outputs.version }}\"" ./charts/otf-agent/Chart.yaml
# bump patch in chart version
CHART=otfd make bump-chart-version
CHART=otf-agent make bump-chart-version
# re-generate README.md to reflect updated version
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install norwoodj/tap/helm-docs
helm-docs
- name: Lint check
run: |
helm lint ./charts/otfd
helm lint ./charts/otf-agent
helm template ./charts/otfd > /dev/null
helm template ./charts/otf-agent --set token=my_agent_token --set url=https://otf.ninja > /dev/null
- name: Create kind cluster
uses: helm/[email protected]
- name: Test
run: |
make test-otfd
- name: Debug
if: failure()
run: |
kubectl -n otfd-test get all
kubectl -n otfd-test describe pod
kubectl -n otfd-test logs -l app.kubernetes.io/name=postgres
kubectl -n otfd-test logs -l app.kubernetes.io/name=otfd
- name: Checkout charts repo
uses: actions/checkout@v4
with:
path: otf-charts
token: ${{ secrets.OTF_CHARTS_TOKEN }}
repository: leg100/otf-charts
- name: Copy charts to charts repo
run: |
cp -R ./charts ./otf-charts/
- name: Commit changes to otf-charts repo
run: |
# switch to checkout of otf-charts repo
cd ./otf-charts
# stage changes and commit
git config --global user.email "[email protected]"
git config --global user.name "Chart bumper"
git add -A
git commit -m "New otf version ${{ needs.release-please.outputs.tag_name }}"
git push origin master