diff options
author | Daniel Xu <dxu@dxuuu.xyz> | 2020-08-24 13:00:15 -0700 |
---|---|---|
committer | Daniel Xu <dxu@dxuuu.xyz> | 2020-08-24 13:36:02 -0700 |
commit | a17c8b4d2705a2c441c00916e1ce69e553d09788 (patch) | |
tree | 94eec8cd51f08e6a6bf729c792383014f85113a2 | |
parent | 37afc3a221b9cc479aa201db634cbfb7daae3cb0 (diff) |
ci: Set up github actions CIci
The CI will now:
* run rustfmt
* build+install fbthrift
* build code
* test code
-rw-r--r-- | .github/workflows/ci.yml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..dac61331 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: [push, pull_request] +jobs: + rustfmt: + # Only run clang-format on pull requests. We want to allow people to + # ignore rustfmt if they think it's not helpful. + if: "github.event_name == 'pull_request'" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run rustmt + # rustfmt tries to format the hidden facebook:: modules but chokes b/c + # those files aren't published to github. Instead, we'll do a git diff + # to see if anything was changed. + run: cargo fmt || true + - name: Check for diff + run: git diff --exit-code + + fbthrift: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Create directory for fbthrift + run: mkdir -p /tmp/fbthrift + - name: Build and install fbthrit + run: ./build/fbcode_builder/getdeps.py build fbthrift --install-prefix /tmp/fbthrift + + build_test: + runs-on: ubuntu-latest + needs: fbthrift + env: + THRIFT: /tmp/fbthrift/bin/thrift1 + steps: + - uses: actions/checkout@v2 + - name: Install deps + run: sudo apt-get install -y zlib1g-dev libelf-dev + - name: Build + run: cargo build + - name: Test + run: cargo test |