Skip to content

Switching from make to just #158

Switching from make to just

Switching from make to just #158

Workflow file for this run

name: CI Pipeline
on:
push:
branches: ["main"]
paths-ignore:
- "etc/**"
- "api/**"
- "deploy/**"
- "scripts/**"
- "tests/**"
- ".vscode/**"
- "readme.md"
- "makefile"
pull_request:
branches: ["main"]
permissions:
packages: write
checks: write
jobs:
lint-test:
name: Testing & Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install just
uses: taiki-e/install-action@just
- name: Install tools
run: just install
- name: Linting & formatting
run: just lint
# Run tests and filter the output to JUnit format
- name: Run unit tests
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
go test -v 2>&1 ./... | go-junit-report -set-exit-code > unit-test-results.xml
- name: Test Report (Unit)
uses: phoenix-actions/test-reporting@v8
if: success() || failure()
with:
name: Unit Tests
path: unit-test-results.xml
reporter: java-junit
# Run API integration tests with output in JUnit format
- name: Run API integration tests
env:
PROMETHEUS_ENABLED: "1"
API_ENDPOINT: http://localhost:8000/api
run: |
just run-all &
sleep 25
just test-api true
- name: Test Report (Integration)
uses: phoenix-actions/test-reporting@v8
if: success() || failure()
with:
name: Integration Tests
path: api-test-results.xml
reporter: java-junit
- name: Check the build
env:
VERSION: dev
BUILD_INFO: "ignore me"
IMAGE_REG: ignored
IMAGE_NAME: ignored
IMAGE_TAG: ignored
run: just build
image-build:
name: Build and push images
if: github.ref == 'refs/heads/main'
env:
IMAGE_TAG: dev
VERSION: dev
BUILD_INFO: "CI build, SHA:${{ github.sha }}"
runs-on: ubuntu-latest
needs: lint-test
steps:
- uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Build images
run: just images
- name: Push images
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin
just push