From ed8a273a0a3ab32a7f0eaafb53fddfafeb0d7e89 Mon Sep 17 00:00:00 2001 From: Jost Berthold Date: Tue, 12 Nov 2024 17:30:26 +1100 Subject: [PATCH] Set up a basic CI build --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ Makefile | 4 ++++ 2 files changed, 53 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d0fc7b9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: 'Test' +on: + pull_request: + branches: [ $default-branch ] + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + integration-tests: + name: "Integration tests" + runs-on: [self-hosted, linux, normal] + steps: + - name: 'Check out code' + uses: actions/checkout@v4 + with: + token: ${{ secrets.JENKINS_GITHUB_PAT }} + submodules: recursive + + - name: "Set up nightly Rust" # https://github.com/rust-lang/rustup/issues/3409 + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2024-08-28 + + - name: 'Set up tree for rust dependency' + run: make setup + + - name: 'Cache smir_pretty and rustc' + uses: Swatinem/rust-cache@v2 + with: + workspaces: | + . + deps/rust/src + cache-directories: | + target + deps/rust/src/build + deps/rust/src/target + + - name: 'Build smir_pretty and its rustc dependency' + run: | # rustc bootstrap checks this and refuses stage 1 in "CI" + export GITHUB_ACTIONS="in denial" && \ + echo "GITHUB_ACTIONS = ${GITHUB_ACTIONS}" && \ + make build_all + + - name: 'Run smir integration tests' + run: | + make integration-test diff --git a/Makefile b/Makefile index 53903ca..44c6e76 100644 --- a/Makefile +++ b/Makefile @@ -84,3 +84,7 @@ generate_ui_tests: cd "${RUST_SRC}"; ./get_runpass.sh tests/ui > "${RUST_DIR}"/tests_ui_sources -cd "${RUST_SRC}"; ./ui_compiletest.sh "${RUST_SRC}" "${RUST_DIR}"/tests/ui/upstream "${RUST_DIR}"/tests_ui_sources --pass check --force-rerun 2>&1 > "${RUST_DIR}"/tests_ui_upstream.log -cd "${RUST_SRC}"; RUST_BIN="${PWD}"/run.sh ./ui_compiletest.sh "${RUST_SRC}" "${RUST_DIR}"/tests/ui/smir "${RUST_DIR}"/tests_ui_sources --pass check --force-rerun 2>&1 > "${RUST_DIR}"/tests_ui_smir.log + +.PHONY: integration-test +integration-test: + @echo "Implement me!"