feat: add macOS (Apple Silicon) build support #1304
This file contains hidden or 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: Build DAPHNE | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: daphneeu/github-action:latest | |
| env: | |
| # fix usage of tput in build script: | |
| TERM: dumb | |
| DEBIAN_FRONTEND: noninteractive | |
| CCACHE_DIR: /github/home/.ccache | |
| CCACHE_COMPRESS: "true" | |
| CCACHE_MAXSIZE: 4G | |
| CCACHE_BASEDIR: ${{ github.workspace }} | |
| CCACHE_NOHASHDIR: "true" | |
| CCACHE_SLOPPINESS: "time_macros,include_file_mtime,include_file_ctime" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Fix working dir permissions | |
| run: chown root:root . | |
| - name: Restore ccache | |
| id: ccache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: > | |
| ccache-${{ runner.os }}-${{ github.job }}- | |
| ${{ hashFiles('**/CMakeLists.txt', '**/*.cmake', '.github/workflows/main.yml', 'build.sh') }}- | |
| ${{ github.ref_name }}-${{ github.sha }} | |
| restore-keys: | | |
| ccache-${{ runner.os }}-${{ github.job }}- | |
| - name: ccache config | |
| run: ccache -p | |
| - name: ccache zero stats | |
| run: ccache -z || true | |
| - name: Building | |
| run: ./build.sh --no-fancy --no-deps --installPrefix /usr/local --target all | ts | |
| shell: bash | |
| - name: ccache stats | |
| run: ccache -s || true | |
| - name: Save ccache (main) | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: ${{ steps.ccache-restore.outputs.cache-primary-key }} | |
| - name: Save ccache (PR, non-fork) | |
| if: > | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.fork == false | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ${{ env.CCACHE_DIR }} | |
| key: > | |
| ccache-${{ runner.os }}-${{ github.job }}- | |
| ${{ github.event.pull_request.number }}-${{ github.sha }} | |
| - name: Testing | |
| run: ./test.sh --no-build | |
| - name: "List generated files" | |
| run: | | |
| ls -la bin | |
| ls -la lib | |
| - name: "Run a simple daph script" | |
| run: bin/daphne scripts/examples/hello-world.daph | |
| - name: 'Upload Artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: daphne | |
| path: | | |
| bin/ | |
| lib/ |