-
Notifications
You must be signed in to change notification settings - Fork 41
147 lines (141 loc) · 4.22 KB
/
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches: '*'
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build-mm0-rs:
name: mm0-rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache mm0-rs
id: cache-mm0-rs
uses: actions/cache@v2
with:
path: mm0-rs/target/release/mm0-rs
key: ${{ runner.os }}-mm0-rs-${{ hashFiles('mm0-rs/**') }}
- name: Install stable rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
default: true
- name: Cache build mm0-rs
id: cache-build-mm0-rs
if: ${{ !steps.cache-mm0-rs.outputs.cache-hit }}
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
mm0-rs/target
key: ${{ runner.os }}-cargo-release-${{ hashFiles('mm0-rs/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-release-
- name: Build mm0-rs
if: ${{ !steps.cache-mm0-rs.outputs.cache-hit }}
working-directory: mm0-rs
run: cargo build --verbose --release
- name: Run tests
if: ${{ !steps.cache-mm0-rs.outputs.cache-hit }}
working-directory: mm0-rs
run: cargo test --verbose --release
- uses: actions/upload-artifact@v2
with:
name: mm0-rs
path: mm0-rs/target/release/mm0-rs
clippy-mm0-rs:
name: Clippy mm0-rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install nightly rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
default: true
- name: Cache clippy
id: cache-nightly-mm0-rs
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
mm0-rs/target
key: ${{ runner.os }}-cargo-nightly-${{ hashFiles('mm0-rs/Cargo.lock') }}
- name: Clippy
working-directory: ./mm0-rs
run: ./clippy.sh
peano:
name: Peano MM1 files
runs-on: ubuntu-latest
needs: build-mm0-rs
if: ${{ always() }}
steps:
- uses: actions/checkout@v2
- run: mkdir -p "$GITHUB_WORKSPACE/bin"
- uses: actions/download-artifact@v2
with:
name: mm0-rs
path: ./bin
- working-directory: mm0-c
run: gcc main.c -O2 -Wall -o $GITHUB_WORKSPACE/bin/mm0-c
- working-directory: bin
run: |
chmod +x mm0-rs
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: peano.mm1
working-directory: examples
run: mm0-rs compile -W peano.mm1 peano.mmb
- name: peano.mmb
working-directory: examples
run: mm0-c peano.mmb < peano.mm0
- name: peano_hex_join.mm0
working-directory: examples
run: mm0-rs join peano_hex.mm0 | tee peano_hex_join.mm0
- name: peano_hex.mm1
working-directory: examples
run: mm0-rs compile -W peano_hex.mm1 peano_hex.mmb
- name: peano_hex.mmb
working-directory: examples
run: mm0-c peano_hex.mmb < peano_hex_join.mm0
- name: mm0_join.mm0
working-directory: examples
run: mm0-rs join mm0.mm0 | tee mm0_join.mm0
- name: mm0.mm1
working-directory: examples
run: mm0-rs compile -W mm0.mm1 mm0.mmb
- name: mm0.mmb
working-directory: examples
run: mm0-c mm0.mmb < mm0_join.mm0
- name: x86_join.mm0
working-directory: examples
run: mm0-rs join x86.mm0 | tee x86_join.mm0
- name: x86.mm1
working-directory: examples
run: mm0-rs compile -W x86.mm1 x86.mmb
- name: x86.mmb
working-directory: examples
run: mm0-c x86.mmb < x86_join.mm0
- name: compiler_join.mm0
working-directory: examples
run: mm0-rs join compiler.mm0 | tee compiler_join.mm0
- name: compiler.mm1
working-directory: examples
run: mm0-rs compile -W compiler.mm1 compiler.mmb
- name: compiler.mmb
working-directory: examples
# run: mm0-c compiler.mmb < x86_join.mm0
run: mm0-c compiler.mmb < compiler_join.mm0
- name: hello_mmc.mm1
working-directory: examples
run: mm0-rs compile -W hello_mmc.mm1 hello_mmc.mmb
- name: hello_mmc.mmb
working-directory: examples
run: mm0-c hello_mmc.mmb < compiler_join.mm0