diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f4c6edb..25a71a32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,25 +72,12 @@ jobs: run: ./artifacts/linux-x64/isograph_cli --config ./demos/${{ matrix.target.folder }}/isograph.config.json - name: 'Check working directory status' run: './scripts/check-git-status.sh' + build-json-schema: name: Build json schema - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable - override: true - target: x86_64-unknown-linux-musl - - name: Build isograph_config with cargo - run: cargo build --bin isograph_config --target x86_64-unknown-linux-musl --release - - name: Make artifact executable - run: chmod +x ./target/x86_64-unknown-linux-musl/release/isograph_config - - name: Build json schema - run: ./target/x86_64-unknown-linux-musl/release/isograph_config - - name: Check working directory status - run: './scripts/check-git-status.sh' + uses: ./.github/workflows/run-cargo-bin-and-ensure-no-changes.yml + with: + binary: isograph_config typecheck-demos: name: Typecheck and Lint Demos diff --git a/.github/workflows/run-cargo-bin-and-ensure-no-changes.yml b/.github/workflows/run-cargo-bin-and-ensure-no-changes.yml new file mode 100644 index 00000000..fcea1408 --- /dev/null +++ b/.github/workflows/run-cargo-bin-and-ensure-no-changes.yml @@ -0,0 +1,27 @@ +on: + workflow_call: + inputs: + binary: + required: true + type: string + +jobs: + build-and-run-binary: + name: Build and run ${{ inputs.binary }} and ensure no files have been modified + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + override: true + target: x86_64-unknown-linux-musl + - name: Build ${{ inputs.binary }} with cargo + run: cargo build --bin ${{ inputs.binary }} --target x86_64-unknown-linux-musl --release + - name: Make artifact executable + run: chmod +x ./target/x86_64-unknown-linux-musl/release/${{ inputs.binary }} + - name: Run ${{ inputs.binary }} + run: ./target/x86_64-unknown-linux-musl/release/${{ inputs.binary }} + - name: Check working directory status + run: './scripts/check-git-status.sh'