-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.1 KB
/
linux.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: linux
on:
workflow_dispatch:
pull_request:
types:
- opened
push:
paths-ignore:
- '.github/workflows/windows.yaml'
# - '.github/workflows/macos.yaml'
- 'README.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
arch: [x86_64]
mode: [release]
compiler: [clang, gcc]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download ISPC
run: |
curl -L "https://github.com/ispc/ispc/releases/download/v1.22.0/ispc-v1.22.0-linux.tar.gz" -o ispc.tar.gz
tar -xzf ispc.tar.gz
echo "${PWD}/ispc-v1.22.0-linux/bin" >> $GITHUB_PATH
# Install system dependencies (opengl)
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev clang libomp-dev libc++-dev gcc g++ gobjc
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@master
actions-cache-folder: .xmake-cache
# Update xmake repository
- name: Update xmake repository
run: xmake repo --update
# Create xmake dependencies hash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}
# Config xmake
- name: Config
run: |
xmake f -vD -y -a ${{ matrix.arch }} -m ${{ matrix.mode }} --toolchain=${{ matrix.compiler }}
# Build
- name: Build
run: |
xmake -vD
- name: Test
run: |
xmake test