Skip to content

Commit 6945fa0

Browse files
committed
WIP: Move from Azure Pipelines to GitHub Actions
This simplifies the CI setup substantially. Fixes: immunant#1226
1 parent 4b7691e commit 6945fa0

File tree

2 files changed

+78
-120
lines changed

2 files changed

+78
-120
lines changed

.github/workflows/ci.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- uses: actions/checkout@v3
14+
- run: rustup component add rustfmt rustc-dev
15+
# Needs adding to the safelist for c2rust GitHub Actions
16+
#- uses: Swatinem/rust-cache@v2
17+
- run: |
18+
sudo apt-get update
19+
sudo apt-get install \
20+
clang-15 \
21+
clang-tools-15 \
22+
cmake \
23+
curl \
24+
git \
25+
gperf \
26+
libbrotli-dev \
27+
libclang-dev \
28+
libgcrypt20 \
29+
libreadline-dev \
30+
libidn2-dev \
31+
libldap2-dev \
32+
libncurses5-dev \
33+
libnghttp2-dev \
34+
libpcre3-dev \
35+
libpsl-dev \
36+
librtmp-dev \
37+
libssl-dev \
38+
libtool \
39+
llvm-15 \
40+
llvm-15-tools \
41+
luarocks \
42+
ninja-build \
43+
pkg-config \
44+
python3-pip \
45+
python3-setuptools \
46+
python3-wheel \
47+
rcs \
48+
strace \
49+
unzip \
50+
zlib1g-dev
51+
- name: Provision Python Packages
52+
run: python3 -m pip install -r $GITHUB_WORKSPACE/scripts/requirements.txt
53+
- name: cargo fmt --check
54+
run: |
55+
export RUSTFLAGS="-D warnings"
56+
export RUSTDOCFLAGS="-D warnings"
57+
cargo fmt --check
58+
- name: cargo build --release
59+
run: |
60+
export RUSTFLAGS="-D warnings"
61+
export RUSTDOCFLAGS="-D warnings"
62+
# Don't build with `--all-features` as `--all-features` includes `--features llvm-static`,
63+
# which we don't want to test here (see https://github.com/immunant/c2rust/issues/500).
64+
cargo build --release
65+
- name: cargo test --release --workspace
66+
run: |
67+
export RUSTFLAGS="-D warnings"
68+
export RUSTDOCFLAGS="-D warnings"
69+
cargo test --release --workspace
70+
- name: Test translator
71+
run: |
72+
# `test_translator.py` compiles translated code,
73+
# which has tons of warnings.
74+
# `RUSTFLAGS="-D warnings"` would be inherited by that,
75+
# causing tons of errors, so don't set that.
76+
# `test_translator.py` does not rebuild,
77+
# so changing `RUSTFLAGS` will not trigger a full rebuild.
78+
./scripts/test_translator.py tests/

azure-pipelines.yml

-120
This file was deleted.

0 commit comments

Comments
 (0)