-
Notifications
You must be signed in to change notification settings - Fork 4
65 lines (50 loc) · 1.98 KB
/
ci.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
name: ci
on:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
OPENBSD_COMMIT: 6354f7248140d3c98676a00bc94948c0a0e89826
jobs:
test:
name: test ${{ matrix.os }} rust ${{ matrix.rust }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- name: Install Homebrew llvm on macOS
if: matrix.os == 'macos-latest'
run: brew install llvm
- run: rustup default ${{ matrix.rust }}
- run: rustup update ${{ matrix.rust }}
- run: rustup target add wasm32-unknown-unknown
- run: curl -L -o code.tar.gz https://github.com/openbsd/src/archive/${{env.OPENBSD_COMMIT}}.tar.gz
- run: tar xzf code.tar.gz src-${{env.OPENBSD_COMMIT}}/include/ src-${{env.OPENBSD_COMMIT}}/sys/sys/ src-${{env.OPENBSD_COMMIT}}/lib/libc/string/ src-${{env.OPENBSD_COMMIT}}/lib/libc/stdlib/
- run: mv src-${{env.OPENBSD_COMMIT}} openbsd-src
- run: find openbsd-src -type f -name "*.3" -exec rm -f {} +
- run: rm openbsd-src/sys/sys/videoio.h
- run: rm openbsd-src/sys/sys/sysctl.h
- run: rm openbsd-src/lib/libc/stdlib/malloc.c
- run: ls -la
- run: rm code.tar.gz
- run: cargo build --target wasm32-unknown-unknown
- if: matrix.os == 'macos-latest'
run: cargo publish --allow-dirty --no-verify --dry-run
- if: matrix.os != 'macos-latest'
run: cargo publish --allow-dirty --dry-run
publish:
needs: [test]
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'wasm32-unknown-unknown-openbsd-libc@') && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- run: rustup default stable
- run: rustup update stable
# - run: cargo publish --allow-dirty --token ${{ secrets.CARGO_TOKEN }}