From b52c54e7f8a3103ec64b1d04a90d3981d18d2902 Mon Sep 17 00:00:00 2001 From: Jonathan LEI Date: Thu, 22 Aug 2024 08:24:15 +0800 Subject: [PATCH] ci: ensure lock files are up-to-date --- .github/workflows/pr.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..426370f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,34 @@ +name: "PR" + +on: + push: + branches: + - "main" + pull_request: + +concurrency: + group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" + cancel-in-progress: true + +jobs: + lock-files: + name: "Check lock files" + runs-on: ["runs-on", "runner=8cpu-linux-x64", "run-id=${{ github.run_id }}"] + env: + CARGO_NET_GIT_FETCH_WITH_CLI: "true" + steps: + - name: "Checkout sources" + uses: "actions/checkout@v4" + + - name: "Update lock files" + run: | + cargo tree + (cd ./bin/client-eth && cargo tree) + (cd ./bin/client-op && cargo tree) + + - name: "Assert no changes" + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "Lock files not up to date" + exit 1 + fi