Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add cosmocc actions #6083

Merged
merged 9 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/cosmocc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Cosmocc (linux-x86_64)

on:
pull_request:
push:
release:
types: [published]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and we can use single yml file.

os: [ubuntu-latest, macos-13]

arch: [x86_64]

runs-on: ${{ matrix.os }}

concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v2
with:
submodules: true

- 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
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: Tests
run: |
ls -l core/build/
core/build/xmake --version
core/build/xmake lua -v -D tests/run.lua

- name: Artifact
uses: actions/upload-artifact@v4
with:
name: xmake-cosmocc
path: core/build/xmake
66 changes: 66 additions & 0 deletions .github/workflows/cosmocc_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Cosmocc (macos-x86_64)

on:
pull_request:
push:
release:
types: [published]
jobs:
build:
strategy:
matrix:
os: [macos-13]
arch: [x86_64]

runs-on: ${{ matrix.os }}

concurrency:
group: ${{ github.ref }}-${{ github.base_ref }}-${{ github.head_ref }}-Cosmocc-${{ matrix.arch }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to set different key for linux/macos.

cancel-in-progress: true
steps:
- uses: actions/checkout@v2
with:
submodules: true

- 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: Installation
run: |
brew install dmd
brew install dub

- name: Build
run: |
cd core
xmake f -p linux --cosmocc=y --embed=y -y -cvD
xmake -v
cd ..

# In the tests, cmake tries to use make from the cosmopolitan toolchain and fails, so uninstall it
- name: Remove cosmocc
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
uses: actions/upload-artifact@v4
with:
name: xmake-cosmocc
path: core/build/xmake
Loading