Skip to content

Commit

Permalink
Add GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hakman committed Jun 17, 2024
1 parent 722a92a commit 8c0b07d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Bazel

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Build etcd-manager
run: |
./dev/build-assets.sh $(git describe --always 2>/dev/null)
working-directory: ./etcd-manager/

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Test etcd-manager
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --test_output=streamed -- //... -//test/integration/upgradedowngrade:all -//test/integration/backuprestore:all
working-directory: ./etcd-manager/

test-upgradedowngrade:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Test etcd-manager
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --test_output=streamed -- //test/integration/upgradedowngrade:all
working-directory: ./etcd-manager/

test-backuprestore:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64"
mkdir -p "${GITHUB_WORKSPACE}/bin/"
mv bazelisk-linux-amd64 "${GITHUB_WORKSPACE}/bin/bazel"
chmod +x "${GITHUB_WORKSPACE}/bin/bazel"
- name: Test etcd-manager
run: |
"${GITHUB_WORKSPACE}/bin/bazel" test --test_output=streamed -- //test/integration/backuprestore:all
working-directory: ./etcd-manager/
22 changes: 22 additions & 0 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: tag-release

on:
push:
branches:
- master
paths:
- version.txt

jobs:
tag-release:
if: ${{ github.repository == 'kubernetes-sigs/etcd-manager' }}
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4
- run: /usr/bin/git config --global user.email [email protected]
- run: /usr/bin/git config --global user.name 'GitHub Actions Release Tagger'
- run: etcd-manager/dev/tag-release.sh

0 comments on commit 8c0b07d

Please sign in to comment.