-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.74 KB
/
windows.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
name: windows
on:
workflow_dispatch:
pull_request:
types:
- opened
push:
paths-ignore:
- '.github/workflows/linux.yaml'
# - '.github/workflows/macos.yaml'
- 'README.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
arch: [x64]
mode: [release]
compiler: [msvc]
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: .xmake-cache
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update
# Fetch xmake dep hash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: Windows-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}
- name: Config
run: |
xmake f -y -a ${{ matrix.arch }} -m ${{ matrix.mode }} --toolchain=${{ matrix.compiler }}
- name: Build
run: |
xmake -vD
- name: Test
run: |
xmake test