-
-
Notifications
You must be signed in to change notification settings - Fork 8
104 lines (90 loc) · 2.75 KB
/
dev-build.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Dev
on:
workflow_dispatch:
inputs:
source:
description: "Source ref used to build bindings. Uses `github.ref`` by default."
required: false
sha:
description: "Source SHA used to build bindings. Uses `github.sha`` by default."
required: false
push:
branches: [dev/**, refactor/**]
env:
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
CARGO_TERM_COLOR: always
CARGO_TERM_PROGRESS_WHEN: never
CARGO_INCREMENTAL: 1
# logging:
RUST_LOG: trace
CARGO_PLAYDATE_LOG: trace
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source || github.ref || github.event.ref }}
- name: Cache
uses: actions/[email protected]
with:
path: |
target/
~/.cargo
key: ${{ runner.os }}-dev-build-${{ hashFiles('Cargo.lock') }}
- name: Config
run: |
mkdir -p .cargo
cp -rf .github/config.toml .cargo/config.toml
- name: Cache LLVM
id: cache-llvm
if: runner.os == 'Windows'
uses: actions/[email protected]
with:
path: ${{ runner.temp }}/llvm
key: llvm-14.0
# See:
# https://github.com/rust-lang/rust-bindgen/issues/1797
# https://rust-lang.github.io/rust-bindgen/requirements.html#windows
- name: Install LLVM
if: runner.os == 'Windows'
uses: KyleMayes/[email protected]
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
env: true
- name: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y
- name: pdtool with tracing
run: cargo build -p=playdate-tool2 --bin=pdtool --features=tracing
- name: Upload
id: upload
uses: actions/upload-artifact@v4
with:
name: pdtool-${{ runner.os }}-${{ runner.arch }}${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
path: target/debug/pdtool${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
if-no-files-found: warn
retention-days: 3
overwrite: true
- name: Artifact
run: |
echo 'ID: ${{ steps.upload.outputs.artifact-id }}'
echo 'URL: ${{ steps.upload.outputs.artifact-url }}'
outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
artifact-url: ${{ steps.upload.outputs.artifact-url }}