|
| 1 | +# https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +name: debug build + test |
| 6 | + |
| 7 | +jobs: |
| 8 | + check: |
| 9 | + name: c2rust |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + |
| 15 | + # https://github.com/marketplace/actions/rust-toolchain |
| 16 | + - name: Install Rust |
| 17 | + uses: actions-rs/toolchain@v1 |
| 18 | + with: |
| 19 | + toolchain: nightly-2019-12-05 # rust-toolchain |
| 20 | + default: true # set as default toolchain |
| 21 | + override: true # set toolchain for workdir |
| 22 | + profile: minimal # TODO? rustup set profile {value} |
| 23 | + #components: rustfmt, clippy |
| 24 | + components: rustfmt-preview, rustc-dev # scripts/provision_rust.sh |
| 25 | + |
| 26 | + # https://github.com/marketplace/actions/rust-cache |
| 27 | + - name: Enable Rust cache |
| 28 | + uses: Swatinem/rust-cache@v1 |
| 29 | + with: |
| 30 | + cache-on-failure: true # Cache even if the build fails |
| 31 | + |
| 32 | + # https://github.com/actions/setup-python |
| 33 | + # python is needed for build + test |
| 34 | + #- name: Install python |
| 35 | + # uses: actions/setup-python@v2 |
| 36 | + # with: |
| 37 | + # python-version: '3.x' |
| 38 | + |
| 39 | + # scripts/provision_deb.sh |
| 40 | + - name: Install dependencies |
| 41 | + run: sudo apt-get install -y cmake clang curl dirmngr git gnupg2 gperf htop libssl-dev ninja-build pkg-config python-dev python3-pip python3-setuptools software-properties-common unzip libncurses5-dev # luarocks |
| 42 | + |
| 43 | + - name: Install python dependencies |
| 44 | + run: pip install -r scripts/requirements.txt |
| 45 | + |
| 46 | + # https://github.com/marketplace/actions/install-luarocks |
| 47 | + - uses: leafo/gh-actions-lua@v8 |
| 48 | + - uses: leafo/gh-actions-luarocks@v4 |
| 49 | + - name: install lua dependencies |
| 50 | + run: luarocks install penlight |
| 51 | + |
| 52 | + # https://github.com/actions-rs/cargo |
| 53 | + - name: build |
| 54 | + uses: actions-rs/cargo@v1 |
| 55 | + with: |
| 56 | + command: build |
| 57 | + #args: --release --all-features # release build is much slower |
| 58 | + |
| 59 | + - name: test |
| 60 | + run: python3 ./scripts/test_translator.py --debug ./tests |
| 61 | + |
| 62 | +# - name: Run cargo check |
| 63 | +# uses: actions-rs/cargo@v1 |
| 64 | +# with: |
| 65 | +# command: check |
0 commit comments