Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tag 'tags/v0.27.0' into develop #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CodeQL Analysis

on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'

jobs:
CodeQL-Build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
8 changes: 4 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
os: [ ubuntu-latest ]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '>= 1.19.1'
go-version: stable
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Docker Build
run: make docker-watchmantest && make docker-webhook
run: make docker-watchmantest
119 changes: 119 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Go Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
# Settings for test_split
total_test_splits: [5]
index: [0, 1, 2, 3, 4]

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable
id: go

- name: Setup
if: runner.os == 'Linux'
run: docker-compose up -d mysql

- name: Generate go test Slice
id: test_split
uses: hashicorp-forge/go-test-split-action@v1
with:
total: ${{ matrix.total_test_splits }}
index: ${{ matrix.index }}

- name: Run Tests (Linux)
if: runner.os == 'Linux'
env:
GOTEST_FLAGS: '-run "${{ steps.test_split.outputs.run}}"'
run: make check

- name: Run Short Tests (Non-Linux)
if: runner.os != 'Linux'
env:
GOTEST_FLAGS: '-short -run "${{ steps.test_split.outputs.run}}"'
run: make check

- name: Upload Code Coverage
if: runner.os == 'Linux'
run: bash <(curl -s https://codecov.io/bash)

winbuild:
name: Build (Windows)
runs-on: [ windows-latest ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable
id: go

- name: Install make (Windows)
run: |
choco install -y make mingw

- name: Run Short Tests (Non-Linux)
run: |
go test ./... -short

docker:
name: Docker build
runs-on: [ ubuntu-latest ]
steps:
- name: Setup Node / NPM
if: runner.os == 'Linux'
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Check out code into the Go module directory
uses: actions/checkout@v3

# disable and stop mono-xsp4.service
# Details: https://github.com/actions/virtual-environments/issues/2821
- name: Ubuntu 20.04 Cleanup
if: runner.os == 'Linux'
run: |
sudo systemctl disable mono-xsp4.service || true
sudo systemctl stop mono-xsp4.service || true
sudo killall mono || true

- name: Build Frontend
run: make build

- name: Docker Build
if: runner.os == 'Linux'
run: make docker-hub

- name: Build batchsearch
if: runner.os == 'Linux'
run: make build-batchsearch

# - name: Integration Test
# if: runner.os == 'Linux'
# run: make test-integration

- name: Test Cleanup
if: runner.os == 'Linux' && always()
run: |
docker-compose logs
make clean-integration
10 changes: 5 additions & 5 deletions .github/workflows/openshift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
os: [ ubuntu-latest ]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '>= 1.19.1'
go-version: stable
id: go

- name: Setup Node / NPM
if: runner.os == 'Linux'
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Docker Build
if: runner.os == 'Linux'
Expand Down
174 changes: 174 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Create Release

on:
push:
tags: [ "v*.*.*" ]

jobs:
testing:
name: Testing
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Setup
if: runner.os == 'Linux'
run: docker-compose up -d mysql

- name: Short Tests
if: runner.os == 'Linux'
env:
GOTEST_FLAGS: "-short"
run: make check

create_release:
name: Create Release
needs: [testing]
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: true

- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt

- name: Save Release URL File for publish
uses: actions/upload-artifact@v3
with:
name: release_url
path: release_url.txt

publish:
name: Publish
needs: [testing, create_release]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable
id: go

- name: Setup Node / NPM
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Load Release URL File from release job
uses: actions/download-artifact@v1
with:
name: release_url

- name: Distribute
run: make dist

- name: Get Release File Name & Upload URL
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
env:
TAG_REF_NAME: ${{ github.ref }}
REPOSITORY_NAME: ${{ github.repository }}

- name: Upload Linux Binary
if: runner.os == 'Linux'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./bin/watchman-linux-amd64
asset_name: watchman-linux-amd64
asset_content_type: application/octet-stream

- name: Upload macOS Binary
if: runner.os == 'macOS'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./bin/watchman-darwin-amd64
asset_name: watchman-darwin-amd64
asset_content_type: application/octet-stream

- name: Upload Windows Binary
if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ./bin/watchman.exe
asset_name: watchman.exe
asset_content_type: application/octet-stream

docker:
name: Docker
needs: [testing, create_release]
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: stable
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Clean
run: make clean

- name: Docker Hub
run: make docker-hub

- name: Docker Openshift
run: make docker-openshift

- name: Docker Static
run: make docker-static

- name: Docker watchmantest
run: make docker-watchmantest

- name: Docker Push
run: |+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
make release-push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Quay.io Push
run: |+
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin quay.io
make quay-push
env:
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
os: [ ubuntu-latest ]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '>= 1.19.1'
go-version: stable
id: go

- name: Setup Node / NPM
if: runner.os == 'Linux'
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '20'

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
Loading
Loading