Check gocryptfs binary #15
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: Check gocryptfs binary | |
on: | |
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 }}" == "main" && "${{ 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 |