Skip to content

Commit

Permalink
feat: initial pipeline setup (#37)
Browse files Browse the repository at this point in the history
* getting started on a proper pipeline

---------

Co-authored-by: Nick VanCise
  • Loading branch information
thenick775 authored Dec 26, 2023
1 parent 5773af3 commit 62815d3
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 45 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/admin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: admin

on:
push:
branches: ['**']

jobs:
pre_job:
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'

build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/server/admin

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: docker/server/admin
sparse-checkout-cone-mode: false

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: docker/server/admin/go.sum

- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi

- name: Build
run: make build

# TODO
# - name: Test
# run: go test --v --cover --race ./...
48 changes: 48 additions & 0 deletions .github/workflows/auth.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: auth

on:
push:
branches: ['**']

jobs:
pre_job:
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'

build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docker/server/auth

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: docker/server/auth
sparse-checkout-cone-mode: false

- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
check-latest: true
cache-dependency-path: docker/server/auth/go.sum

- name: Format
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi

- name: Build
run: CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s'

- name: Test
run: go test --v --cover --useosfs --race ./...
54 changes: 54 additions & 0 deletions .github/workflows/gbajs3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Gbajs3

on:
push:
branches: ['**']

jobs:
pre_job:
continue-on-error: true
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'same_content_newer'

build:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./gbajs3

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: gbajs3
sparse-checkout-cone-mode: false

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.1.0

- name: Install dependencies
run: |
npm ci
- name: Build
run: |
npm run build
- name: Lint
run: |
npm run lint
# TODO
# - name: Test
# run: |
# npm run test
2 changes: 1 addition & 1 deletion docker/server/admin/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module bin

go 1.17
go 1.19

require (
github.com/GoAdminGroup/go-admin v1.2.24
Expand Down
Loading

0 comments on commit 62815d3

Please sign in to comment.