From 8a7feff4cac5f925b7de982963714b0e81e5adba Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:10:25 +0200 Subject: [PATCH 1/6] temp removed other PR ci stuff, add wc --- .github/workflows/benchmarks.yml | 47 ---------------- .github/workflows/nix_linux_x86_64.yml | 23 -------- .github/workflows/nix_macos_apple_silicon.yml | 36 ------------- .github/workflows/spellcheck.yml | 25 --------- .github/workflows/test_nightly_many_os.yml | 8 +-- .github/workflows/ubuntu_x86_64.yml | 54 ------------------- 6 files changed, 5 insertions(+), 188 deletions(-) delete mode 100644 .github/workflows/benchmarks.yml delete mode 100644 .github/workflows/nix_linux_x86_64.yml delete mode 100644 .github/workflows/nix_macos_apple_silicon.yml delete mode 100644 .github/workflows/spellcheck.yml delete mode 100644 .github/workflows/ubuntu_x86_64.yml diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml deleted file mode 100644 index 58e0ee422c8..00000000000 --- a/.github/workflows/benchmarks.yml +++ /dev/null @@ -1,47 +0,0 @@ -on: [pull_request] - -name: Benchmarks - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - ROC_NUM_WORKERS: 1 - -jobs: - prep-dependency-container: - name: benchmark roc programs - runs-on: [self-hosted, i7-6700K] - timeout-minutes: 60 - env: - FORCE_COLOR: 1 - steps: - - uses: actions/checkout@v3 - with: - ref: "main" - clean: "true" - - - name: Earthly version - run: earthly --version - - - name: on main; prepare a self-contained benchmark folder - run: ./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=main +prep-bench-folder - - - uses: actions/checkout@v3 - with: - clean: "false" # we want to keep the benchmark folder - - - name: on current branch; prepare a self-contained benchmark folder - run: ./ci/safe-earthly.sh +prep-bench-folder - - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - - name: build benchmark runner - run: cd ci/bench-runner && cargo build --release && cd ../.. - - - name: run benchmarks with regression check - run: ./ci/bench-runner/target/release/bench-runner --check-executables-changed diff --git a/.github/workflows/nix_linux_x86_64.yml b/.github/workflows/nix_linux_x86_64.yml deleted file mode 100644 index 17e8e0a013c..00000000000 --- a/.github/workflows/nix_linux_x86_64.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: [pull_request] - -name: Nix linux x86_64 cargo test - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - -jobs: - nix-linux-x86: - name: nix-linux-x86 - runs-on: [self-hosted, i7-6700K] - timeout-minutes: 90 - steps: - - uses: actions/checkout@v3 - with: - clean: "true" - - - name: execute tests with --release - run: /home/big-ci-user/.nix-profile/bin/nix develop -c cargo test --locked --release diff --git a/.github/workflows/nix_macos_apple_silicon.yml b/.github/workflows/nix_macos_apple_silicon.yml deleted file mode 100644 index dd8e49d4db7..00000000000 --- a/.github/workflows/nix_macos_apple_silicon.yml +++ /dev/null @@ -1,36 +0,0 @@ -on: [pull_request] - -name: Nix apple silicon cargo test - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - -jobs: - nix-apple-silicon: - name: nix-apple-silicon - runs-on: [self-hosted, macOS, ARM64] - timeout-minutes: 90 - steps: - - uses: actions/checkout@v3 - with: - clean: "true" - - - name: check formatting with rustfmt - run: nix develop -c cargo fmt --all -- --check - - - name: check code style with clippy - run: nix develop -c cargo clippy --workspace --tests -- --deny warnings - - - name: check code style with clippy --release - run: cargo clippy --workspace --tests --release -- --deny warnings - - - name: execute tests with --release - run: nix develop -c cargo test --locked --release - - # we run the llvm wasm tests only on this machine because it is fast and wasm should be cross-platform - - name: execute llvm wasm tests with --release - run: nix develop -c cargo test-gen-llvm-wasm --locked --release diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml deleted file mode 100644 index e26bfb3d377..00000000000 --- a/.github/workflows/spellcheck.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: [pull_request] - -name: SpellCheck - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - -jobs: - spell-check: - name: spell check - runs-on: [self-hosted] - timeout-minutes: 10 - env: - FORCE_COLOR: 1 - steps: - - uses: actions/checkout@v3 - with: - clean: "true" - - - name: do spell check with typos-cli 1.0.11 # to reproduce locally: cargo install typos-cli --version 1.0.11 - run: typos diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index 0126f1225f3..a124db7f5a1 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -1,6 +1,6 @@ -on: - schedule: - - cron: '0 13 * * *' +on: [pull_request] +# schedule: +# - cron: '0 13 * * *' name: Test latest nightly release for macOS x86_64 @@ -18,6 +18,8 @@ jobs: - name: fetch releases data and save to file run: curl https://api.github.com/repos/roc-lang/roc/releases --output roc_releases.json + - run: cat roc_releases.json | wc -c + - name: get the url of today`s release for linux x86_64 if: startsWith(matrix.os, 'ubuntu') run: echo "RELEASE_URL=$(./ci/get_latest_release_url.sh linux_x86_64)" >> $GITHUB_ENV diff --git a/.github/workflows/ubuntu_x86_64.yml b/.github/workflows/ubuntu_x86_64.yml deleted file mode 100644 index b0220ebf7e4..00000000000 --- a/.github/workflows/ubuntu_x86_64.yml +++ /dev/null @@ -1,54 +0,0 @@ -on: [pull_request] - -name: CI - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - RUST_BACKTRACE: 1 - -jobs: - test-zig-rust-wasm: - name: test zig, rust, wasm... - runs-on: [self-hosted, i5-4690K] - timeout-minutes: 90 - env: - RUSTC_WRAPPER: /home/small-ci-user/.cargo/bin/sccache - steps: - - uses: actions/checkout@v2 - with: - clean: "true" - - - name: Check for duplicate AUTHORS - run: diff <(sort AUTHORS) <(sort AUTHORS | uniq) # The < operator treats a string as a file. diff 'succeeds' if no difference. - - - name: zig fmt check, zig tests - run: cd crates/compiler/builtins/bitcode && ./run-tests.sh - - - name: zig wasm tests - run: cd crates/compiler/builtins/bitcode && ./run-wasm-tests.sh - - - name: regular rust tests - run: cargo test --locked --release --features with_sound serde --workspace && sccache --show-stats - - - name: test the dev backend # these tests require an explicit feature flag - run: cargo test --locked --release --package test_gen --no-default-features --features gen-dev && sccache --show-stats - - - name: test gen-wasm single threaded # gen-wasm has some multithreading problems to do with the wasmer runtime - run: cargo test --locked --release --package test_gen --no-default-features --features gen-wasm -- --test-threads=1 && sccache --show-stats - - - name: run `roc test` on Str builtins - run: cargo run --locked --release -- test crates/compiler/builtins/roc/Str.roc && sccache --show-stats - - #TODO pass --locked into the script here as well, this avoids rebuilding dependencies unnecessarily - - name: wasm repl test - run: crates/repl_test/test_wasm.sh && sccache --show-stats - - #TODO i386 (32-bit linux) cli tests - - #TODO verify-no-git-changes - - - name: test website build script - run: REPL_DEBUG=1 bash www/build.sh From 7a9d60424a155be3738d4bc7f7f65e0cda28e951 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:15:33 +0200 Subject: [PATCH 2/6] cat roc_releases.json Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- .github/workflows/test_nightly_many_os.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index a124db7f5a1..fde8f31d394 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -19,6 +19,8 @@ jobs: run: curl https://api.github.com/repos/roc-lang/roc/releases --output roc_releases.json - run: cat roc_releases.json | wc -c + + - run: cat roc_releases.json - name: get the url of today`s release for linux x86_64 if: startsWith(matrix.os, 'ubuntu') From 1a1f1b6f5749e1e9f131699577405104be2113a0 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:52:25 +0200 Subject: [PATCH 3/6] authenticate request with GITHUB_TOKEN Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com> --- .github/workflows/test_nightly_many_os.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index fde8f31d394..a4cc4a226e5 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -16,7 +16,12 @@ jobs: - uses: actions/checkout@v3 - name: fetch releases data and save to file - run: curl https://api.github.com/repos/roc-lang/roc/releases --output roc_releases.json + run: | + curl --request GET \ + --url https://api.github.com/repos/roc-lang/roc/releases \ + --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ + --header 'content-type: application/json' \ + --output roc_releases.json - run: cat roc_releases.json | wc -c From 0ffcced84d28157c7b84ce29c827aacf48d29d79 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:57:53 +0200 Subject: [PATCH 4/6] put back old PR workflows --- .github/workflows/benchmarks.yml | 47 ++++++++++++++++ .github/workflows/nix_linux_x86_64.yml | 23 ++++++++ .github/workflows/nix_macos_apple_silicon.yml | 36 +++++++++++++ .github/workflows/spellcheck.yml | 25 +++++++++ .github/workflows/ubuntu_x86_64.yml | 54 +++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 .github/workflows/benchmarks.yml create mode 100644 .github/workflows/nix_linux_x86_64.yml create mode 100644 .github/workflows/nix_macos_apple_silicon.yml create mode 100644 .github/workflows/spellcheck.yml create mode 100644 .github/workflows/ubuntu_x86_64.yml diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 00000000000..58e0ee422c8 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,47 @@ +on: [pull_request] + +name: Benchmarks + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + ROC_NUM_WORKERS: 1 + +jobs: + prep-dependency-container: + name: benchmark roc programs + runs-on: [self-hosted, i7-6700K] + timeout-minutes: 60 + env: + FORCE_COLOR: 1 + steps: + - uses: actions/checkout@v3 + with: + ref: "main" + clean: "true" + + - name: Earthly version + run: earthly --version + + - name: on main; prepare a self-contained benchmark folder + run: ./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=main +prep-bench-folder + + - uses: actions/checkout@v3 + with: + clean: "false" # we want to keep the benchmark folder + + - name: on current branch; prepare a self-contained benchmark folder + run: ./ci/safe-earthly.sh +prep-bench-folder + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: build benchmark runner + run: cd ci/bench-runner && cargo build --release && cd ../.. + + - name: run benchmarks with regression check + run: ./ci/bench-runner/target/release/bench-runner --check-executables-changed diff --git a/.github/workflows/nix_linux_x86_64.yml b/.github/workflows/nix_linux_x86_64.yml new file mode 100644 index 00000000000..17e8e0a013c --- /dev/null +++ b/.github/workflows/nix_linux_x86_64.yml @@ -0,0 +1,23 @@ +on: [pull_request] + +name: Nix linux x86_64 cargo test + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + +jobs: + nix-linux-x86: + name: nix-linux-x86 + runs-on: [self-hosted, i7-6700K] + timeout-minutes: 90 + steps: + - uses: actions/checkout@v3 + with: + clean: "true" + + - name: execute tests with --release + run: /home/big-ci-user/.nix-profile/bin/nix develop -c cargo test --locked --release diff --git a/.github/workflows/nix_macos_apple_silicon.yml b/.github/workflows/nix_macos_apple_silicon.yml new file mode 100644 index 00000000000..dd8e49d4db7 --- /dev/null +++ b/.github/workflows/nix_macos_apple_silicon.yml @@ -0,0 +1,36 @@ +on: [pull_request] + +name: Nix apple silicon cargo test + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + +jobs: + nix-apple-silicon: + name: nix-apple-silicon + runs-on: [self-hosted, macOS, ARM64] + timeout-minutes: 90 + steps: + - uses: actions/checkout@v3 + with: + clean: "true" + + - name: check formatting with rustfmt + run: nix develop -c cargo fmt --all -- --check + + - name: check code style with clippy + run: nix develop -c cargo clippy --workspace --tests -- --deny warnings + + - name: check code style with clippy --release + run: cargo clippy --workspace --tests --release -- --deny warnings + + - name: execute tests with --release + run: nix develop -c cargo test --locked --release + + # we run the llvm wasm tests only on this machine because it is fast and wasm should be cross-platform + - name: execute llvm wasm tests with --release + run: nix develop -c cargo test-gen-llvm-wasm --locked --release diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml new file mode 100644 index 00000000000..e26bfb3d377 --- /dev/null +++ b/.github/workflows/spellcheck.yml @@ -0,0 +1,25 @@ +on: [pull_request] + +name: SpellCheck + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + +jobs: + spell-check: + name: spell check + runs-on: [self-hosted] + timeout-minutes: 10 + env: + FORCE_COLOR: 1 + steps: + - uses: actions/checkout@v3 + with: + clean: "true" + + - name: do spell check with typos-cli 1.0.11 # to reproduce locally: cargo install typos-cli --version 1.0.11 + run: typos diff --git a/.github/workflows/ubuntu_x86_64.yml b/.github/workflows/ubuntu_x86_64.yml new file mode 100644 index 00000000000..b0220ebf7e4 --- /dev/null +++ b/.github/workflows/ubuntu_x86_64.yml @@ -0,0 +1,54 @@ +on: [pull_request] + +name: CI + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + +jobs: + test-zig-rust-wasm: + name: test zig, rust, wasm... + runs-on: [self-hosted, i5-4690K] + timeout-minutes: 90 + env: + RUSTC_WRAPPER: /home/small-ci-user/.cargo/bin/sccache + steps: + - uses: actions/checkout@v2 + with: + clean: "true" + + - name: Check for duplicate AUTHORS + run: diff <(sort AUTHORS) <(sort AUTHORS | uniq) # The < operator treats a string as a file. diff 'succeeds' if no difference. + + - name: zig fmt check, zig tests + run: cd crates/compiler/builtins/bitcode && ./run-tests.sh + + - name: zig wasm tests + run: cd crates/compiler/builtins/bitcode && ./run-wasm-tests.sh + + - name: regular rust tests + run: cargo test --locked --release --features with_sound serde --workspace && sccache --show-stats + + - name: test the dev backend # these tests require an explicit feature flag + run: cargo test --locked --release --package test_gen --no-default-features --features gen-dev && sccache --show-stats + + - name: test gen-wasm single threaded # gen-wasm has some multithreading problems to do with the wasmer runtime + run: cargo test --locked --release --package test_gen --no-default-features --features gen-wasm -- --test-threads=1 && sccache --show-stats + + - name: run `roc test` on Str builtins + run: cargo run --locked --release -- test crates/compiler/builtins/roc/Str.roc && sccache --show-stats + + #TODO pass --locked into the script here as well, this avoids rebuilding dependencies unnecessarily + - name: wasm repl test + run: crates/repl_test/test_wasm.sh && sccache --show-stats + + #TODO i386 (32-bit linux) cli tests + + #TODO verify-no-git-changes + + - name: test website build script + run: REPL_DEBUG=1 bash www/build.sh From cfc1b37fbdc2fe90e1d4d17364b92ae8c7c30d95 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 16:59:57 +0200 Subject: [PATCH 5/6] remove debug stuff --- .github/workflows/test_nightly_many_os.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index a4cc4a226e5..178b8a65a5e 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -23,10 +23,6 @@ jobs: --header 'content-type: application/json' \ --output roc_releases.json - - run: cat roc_releases.json | wc -c - - - run: cat roc_releases.json - - name: get the url of today`s release for linux x86_64 if: startsWith(matrix.os, 'ubuntu') run: echo "RELEASE_URL=$(./ci/get_latest_release_url.sh linux_x86_64)" >> $GITHUB_ENV From 04dbf12c7a89eeb9cb09541ff8a53adea6c6a120 Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Fri, 9 Sep 2022 17:01:40 +0200 Subject: [PATCH 6/6] re-enable cron --- .github/workflows/test_nightly_many_os.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_nightly_many_os.yml b/.github/workflows/test_nightly_many_os.yml index 178b8a65a5e..7ff19fcc439 100644 --- a/.github/workflows/test_nightly_many_os.yml +++ b/.github/workflows/test_nightly_many_os.yml @@ -1,6 +1,6 @@ -on: [pull_request] -# schedule: -# - cron: '0 13 * * *' +on: + schedule: + - cron: '0 13 * * *' name: Test latest nightly release for macOS x86_64