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

Major update #56

Merged
merged 23 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
version: 2
updates:
# For the Golang application
- package-ecosystem: "gomod" # This is for Golang modules
directory: "/" # Adjust if your Golang module manifest (go.mod) is in a subdirectory
schedule:
interval: "weekly" # Dependabot will check for updates weekly

# For the React application
- package-ecosystem: "npm" # This is for npm packages used by your React app
directory: "/ui/" # Replace with the path to your React app's directory where package.json is located
schedule:
interval: "weekly" # Dependabot will check for updates weekly
version: 2
updates:
# For the Golang application
- package-ecosystem: "gomod" # This is for Golang modules
directory: "/" # Adjust if your Golang module manifest (go.mod) is in a subdirectory
schedule:
interval: "weekly" # Dependabot will check for updates weekly
# For the React application
- package-ecosystem: "npm" # This is for npm packages used by your React app
directory: "/ui/" # Replace with the path to your React app's directory where package.json is located
schedule:
interval: "weekly" # Dependabot will check for updates weekly
84 changes: 42 additions & 42 deletions .github/workflows/build-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Build and Push Docker Image
on:
create:
tags:
- '*'
jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Clean up directories
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Clean up Docker
run: |
docker system prune -af

- name: Checkout Code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Push Docker Image
env:
DOCKER_BUILDKIT: 1
run: |
docker buildx create --use
# Ensure experimental features are enabled for squashing
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build --squash -t ${{ secrets.DOCKER_USERNAME }}/blackdagger:latest --push .

name: Build and Push Docker Image
on:
create:
tags:
- '*'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Clean up directories
run: |
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Clean up Docker
run: |
docker system prune -af
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
env:
DOCKER_BUILDKIT: 1
run: |
docker buildx create --use
# Ensure experimental features are enabled for squashing
export DOCKER_CLI_EXPERIMENTAL=enabled
docker buildx build --squash -t ${{ secrets.DOCKER_USERNAME }}/blackdagger:latest --push .
85 changes: 85 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"
pull_request:
types:
- opened
- reopened # new commits are pushed to the branch that the PR is based on
- synchronize # new commits are pushed to the branch that the PR is based on
- ready_for_review # PR is ready for review

jobs:

# # Spell check
# codespell:
# name: Check for spelling errors
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Codespell
# uses: codespell-project/actions-codespell@v2

# Lint Go code
golint:
name: Go Linter
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
args: --timeout=10m

# Test Go code
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Build
run: |
make build-bin

- name: Test
run: |
make test-coverage

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51 changes: 0 additions & 51 deletions .github/workflows/release-with-tags.yaml

This file was deleted.

33 changes: 16 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
name: Release

on:
push:
create:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"

jobs:
# Build release binaries
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.21.x

- name: Installing swagger
run: |
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
go-version-file: go.mod

- name: Set up NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: Set up yarn
run: npm install --global yarn

- name: Check out code
uses: actions/checkout@v3

- name: Yarn install
run: yarn install
working-directory: ui
Expand All @@ -38,14 +39,12 @@ jobs:

- name: Copy web assets
run: |
cp ui/dist/*.js ./service/frontend/assets/
cp ui/dist/*.woff ./service/frontend/assets/
cp ui/dist/*.woff2 ./service/frontend/assets/
cp ui/dist/* ./internal/frontend/assets/

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{secrets.BLACKDAGGER_SECRET}}
GITHUB_TOKEN: ${{secrets.BLACKDAGGER_SECRET}}
67 changes: 0 additions & 67 deletions .github/workflows/test.yaml

This file was deleted.

Loading
Loading