Skip to content

Commit

Permalink
Merge pull request #294 from euanwm/feature/devops_cleanup
Browse files Browse the repository at this point in the history
actions cleanup
  • Loading branch information
euanwm authored Jan 21, 2024
2 parents 12bfb58 + 05a39b6 commit 7128ed9
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 70 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build

on:
push:
branches: [ "development", "master" ]
pull_request:
branches: [ "development", "master" ]

jobs:
build_frontend:
defaults:
run:
working-directory: ./frontend/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.X
uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- run: npm install
- run: npm run build --if-present

build_backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.2

- name: Linting
uses: golangci/golangci-lint-action@v3
with:
version: v1.53.3
working-directory: ./backend
args: --verbose

- name: Build
run: |
cd backend/
go build -v
- name: Test
run: |
cd backend/
go test -coverprofile=coverage.txt ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
files: /backend/coverage.txt
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}

build_tool:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files python_tools/'*.py') --fail-under=8
42 changes: 0 additions & 42 deletions .github/workflows/go.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Integration Test

on:
push:
branches: ["development"]
pull_request:
branches: ["development"]

jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.2

- name: Build & Run
run: |
cd backend/
go build -o backend
./backend local &
cd ../frontend/
npm install
npm run test
27 changes: 0 additions & 27 deletions .github/workflows/node.yml

This file was deleted.

2 changes: 1 addition & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func CacheMeOutsideHowBoutDat() {
func main() {
apiServer := buildServer()
go CacheMeOutsideHowBoutDat()
err := apiServer.Run("backend:8080") // listen and serve on
err := apiServer.Run() // listen and serve on
if err != nil {
log.Fatal("Failed to run server")
}
Expand Down

0 comments on commit 7128ed9

Please sign in to comment.