Feat/python tests #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
types: [opened, synchronize] | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: "Branch to run tests on" | |
required: true | |
default: "main" | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set GO_VERSION | |
run: echo "GO_VERSION=$(cat go.mod | grep '^go ' | cut -f2 -d' ')" >> $GITHUB_ENV | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Build binary | |
run: make build | |
- name: Upload binary artifact | |
# if: github.event_name == 'release' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: galacticad | |
path: build/galacticad | |
test: | |
runs-on: self-hosted | |
needs: | |
- build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download binary artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: galacticad | |
path: build | |
- uses: astral-sh/setup-uv@v3 | |
with: | |
version: "latest" | |
- name: Run tests | |
run: make test | |
- name: Test status check | |
if: failure() | |
run: exit 1 | |
permissions: | |
pull-requests: write |