Skip to content

Workflows check test #8

Workflows check test

Workflows check test #8

name: Check gocryptfs binary
on:
push:
branches: [ workflows ]
pull_request:
branches: [ main ]
workflow_dispatch: # This allows manual triggering
jobs:
check_trigger:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- name: Print trigger type
run: |
echo "Trigger type: ${{ github.event_name }}"
echo "GitHub ref: ${{ github.ref }}"
echo "GitHub SHA: ${{ github.sha }}"
echo "Base ref: ${{ github.base_ref }}"
echo "Head ref: ${{ github.head_ref }}"
- id: check
name: Check if should run
run: |
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.head_ref }}" == "workflows" && "${{ github.base_ref }}" == "main" ]] || \
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] || \
[[ "${{ github.run_attempt }}" != "1" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
check_binary:
needs: check_trigger
if: needs.check_trigger.outputs.should_run == 'true'
runs-on: buildjet-4vcpu-ubuntu-2204-arm
steps:
- name: Checkout gocryptfs-magisk repository
uses: actions/checkout@v3
with:
repository: swazau/gocryptfs-magisk
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: List repository contents
run: |
echo "Repository contents:"
ls -R
- name: Check if gocryptfs binary exists
run: |
if [ -f "./system/bin/gocryptfs" ]; then
echo "gocryptfs binary found"
else
echo "gocryptfs binary not found"
exit 1
fi
- name: Set execute permission
run: chmod +x ./system/bin/gocryptfs
- name: Check binary version
run: |
./system/bin/gocryptfs --version
echo "Binary version: $(./system/bin/gocryptfs --version)"
- name: Check binary file type
run: |
file ./system/bin/gocryptfs
echo "File type: $(file ./system/bin/gocryptfs)"
- name: Check binary execution
run: |
./system/bin/gocryptfs --help
echo "Binary execution successful"
# Add more checks as needed