Change src #20
Workflow file for this run
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: 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 | |
with: | |
fetch-depth: 5 | |
- 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@v4 | |
with: | |
path: | | |
onyx/bin | |
key: ${{ runner.os }}-golang-${{ hashFiles('onyx/src/**') }} | |
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'}} | |
- if: ${{ steps.go-cache.outputs.cache-hit != 'true'}} | |
name: Build | |
working-directory: onyx | |
run: | | |
make setup | |
make build | |
test: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Setup Golang caches | |
id: go-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
onyx/bin | |
key: ${{ runner.os }}-golang-${{ hashFiles('onyx/src/**') }} | |
restore-keys: | | |
${{ runner.os }}-golang- | |
- name: Check | |
run: ls -ltr onyx/bin | |