Skip to content

Update pipeline

Update pipeline #7

Workflow file for this run

name: Test onyx pipeline
on:
workflow_dispatch:
push:
branches:
- "test-onyx-caching"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ">=1.20.0"
cache: true
- name: Setup Golang caches
id: go-cache
uses: actions/cache@v3
with:
path: |
onyx/bin
key: ${{ runner.os }}-golang-${{ hashFiles('onyx/bin') }}
restore-keys: |
${{ runner.os }}-golang-
- name: Check if folder has changed
id: check-changes
run: |
diff_output=$(git diff HEAD HEAD~1 -- onyx/)
# Check if the output is empty
if [ -n "$diff_output" ]; then
echo "There are changes."
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "No changes detected."
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Show cache contents
run: |
ls -ltr onyx
- if: ${{ steps.check-changes.outputs.changed == 'true' || steps.go-cache.outputs.cache-hit != 'true'}}
name: Build
working-directory: onyx
run: |
make setup
make build