Skip to content

Commit a7bf658

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

File tree

2 files changed

+63
-120
lines changed

2 files changed

+63
-120
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
libbrotli-dev \
21+
libclang-15-dev \
22+
libgcrypt20 \
23+
libreadline-dev \
24+
libidn2-dev \
25+
libldap2-dev \
26+
libnghttp2-dev \
27+
libpcre3-dev \
28+
libpsl-dev \
29+
librtmp-dev \
30+
libtool \
31+
python3-pip \
32+
python3-setuptools \
33+
python3-wheel \
34+
rcs \
35+
zlib1g-dev
36+
- name: Provision Python Packages
37+
run: python3 -m pip install -r $GITHUB_WORKSPACE/scripts/requirements.txt
38+
- name: cargo fmt --check
39+
run: |
40+
export RUSTFLAGS="-D warnings"
41+
export RUSTDOCFLAGS="-D warnings"
42+
cargo fmt --check
43+
- name: cargo build --release
44+
run: |
45+
export RUSTFLAGS="-D warnings"
46+
export RUSTDOCFLAGS="-D warnings"
47+
# Don't build with `--all-features` as `--all-features` includes `--features llvm-static`,
48+
# which we don't want to test here (see https://github.com/immunant/c2rust/issues/500).
49+
cargo build --release
50+
- name: cargo test --release --workspace
51+
run: |
52+
export RUSTFLAGS="-D warnings"
53+
export RUSTDOCFLAGS="-D warnings"
54+
cargo test --release --workspace
55+
- name: Test translator
56+
run: |
57+
# `test_translator.py` compiles translated code,
58+
# which has tons of warnings.
59+
# `RUSTFLAGS="-D warnings"` would be inherited by that,
60+
# causing tons of errors, so don't set that.
61+
# `test_translator.py` does not rebuild,
62+
# so changing `RUSTFLAGS` will not trigger a full rebuild.
63+
./scripts/test_translator.py tests/

azure-pipelines.yml

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)