Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
realjenius committed Sep 11, 2023
1 parent d69e4e9 commit 987d4a4
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [ aj-main ]
pull_request:
branches: [ aj-main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# depth 0 makes the whole history checked out, and without it the build and tests differ, because default
# depth of 1 might easily fetch a non-tagged commit, hence the version isn't semantic but commit has only
fetch-depth: 0
- name: Print version tag
run: git describe --tags --dirty=-dirty --always
- name: Set up Go
uses: actions/setup-go@v4
with:
cache-dependency-path: go.sum
go-version-file: go.mod
- name: Run unit tests
run: make test-unit
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish

on:
workflow_run:
workflows: [ CI ]
types: [ completed ]
branches: [ ajmain ]

jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The triggering workflow passed'
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'
publish:
runs-on: ubuntu-latest
needs: [ on-success ]
steps:
# Verify the build (same as CI)
- uses: actions/checkout@v3
with:
path: source
- name: Set up Go
uses: actions/setup-go@v4
with:
cache-dependency-path: go.sum
go-version-file: go.mod
- name: Build project
run: make

0 comments on commit 987d4a4

Please sign in to comment.