summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-01-17 22:28:04 +0800
committerGitHub <[email protected]>2025-01-17 22:28:04 +0800
commitce35c1abd92ce10f024210bde748e0bbb86d8250 (patch)
treeed73da5440525182352d3237d29af697e157c1c1
parent217d4adabedf2371f299ab1fbc456f40c24f4e23 (diff)
parentc15679521b694e7112c9e6d5ee0f5a3e70c366a6 (diff)
Merge pull request #6083 from A2va/cosmocc-ci
Re-add cosmocc actions
-rw-r--r--.github/workflows/cosmocc.yml93
1 files changed, 93 insertions, 0 deletions
diff --git a/.github/workflows/cosmocc.yml b/.github/workflows/cosmocc.yml
new file mode 100644
index 000000000..74429e177
--- /dev/null
+++ b/.github/workflows/cosmocc.yml
@@ -0,0 +1,93 @@
+name: Cosmocc
+
+on:
+ pull_request:
+ push:
+ release:
+ types: [published]
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-13]
+ arch: [x86_64]
+
+ runs-on: ${{ matrix.os }}
+
+ concurrency:
+ group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.os }}-${{ matrix.arch }}
+ cancel-in-progress: true
+
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ submodules: true
+
+ - uses: little-core-labs/[email protected]
+ id: tagName
+
+ - name: Prepare local xmake
+ run: cp -rf . ../xmake-source
+
+ - uses: xmake-io/github-action-setup-xmake@v1
+ with:
+ xmake-version: local#../xmake-source
+
+ - uses: bjia56/setup-cosmocc@main
+ with:
+ version: "4.0.2"
+
+ - name: Build
+ run: |
+ cd core
+ xmake f -p linux --cosmocc=y --embed=y -y -cvD
+ xmake -v
+ cd ..
+
+ - name: Prepare (Linux)
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ sudo apt update
+ sudo apt install -y ruby ruby-dev rubygems build-essential llvm libc++-dev
+ sudo apt install -y libgl1-mesa-dev libglu1-mesa-dev
+ clang --version
+
+ - name: Prepare (macOS)
+ if: matrix.os == 'macos-13'
+ run: |
+ brew install dmd
+ brew install dub
+
+ # In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it
+ - name: Remove cosmocc
+ if: matrix.os == 'macos-13'
+ run: |
+ INSTALL_DIR="${{runner.temp}}/cosmocc-4.0.2"
+ echo "Removing cosmocc from PATH"
+ echo "::remove-path::${INSTALL_DIR}/bin"
+ rm -r "${INSTALL_DIR}"
+
+ - name: Tests
+ run: |
+ ls -l core/build/
+ core/build/xmake --version
+ core/build/xmake lua -v -D tests/run.lua
+
+ - name: Artifact
+ if: matrix.os == 'ubuntu-latest'
+ uses: actions/upload-artifact@v4
+ with:
+ name: xmake-bundle.cosmocc.x86_64
+ path: core/build/xmake
+
+ - name: Publish bundle binary
+ if: github.event.action == 'published' && matrix.os == 'ubuntu-latest'
+ uses: actions/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ github.event.release.upload_url }}
+ asset_path: core/build/xmake
+ asset_name: xmake-bundle-${{ steps.tagName.outputs.tag }}.cosmocc.x86_64
+ asset_content_type: application/zip