Skip to content

feat: add ci-cd pipeline #2

feat: add ci-cd pipeline

feat: add ci-cd pipeline #2

Workflow file for this run

on: [push, pull_request]
name: Test, Build and Publish
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.20.x"
- name: Run tests
run: go test -race ./...
goreleaser:
name: Build and Publish
needs: tests

Check failure on line 19 in .github/workflows/ci-cd.yml

View workflow run for this annotation

GitHub Actions / Test, Build and Publish

Invalid workflow file

The workflow is not valid. .github/workflows/ci-cd.yml (Line: 19, Col: 12): Job 'goreleaser' depends on unknown job 'tests'. .github/workflows/ci-cd.yml (Line: 42, Col: 12): Job 'check_brew' depends on job 'goreleaser' which creates a cycle in the dependency graph.
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20.x"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
check_brew:
name: Check Brew Tap
needs: goreleaser
runs-on: macos-latest
steps:
- name: Install with brew
run: |
brew install joshmedeski/sesh/sesh
- name: Check installed sesh version
run: |
[ v$(sesh ---version) == "$GITHUB_REF_NAME" ]