From 1c486b2c73cb2ae896dd77e0f0ec060a47f15cd7 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:10:07 -0700 Subject: [PATCH 01/73] Add one codecov --- codecov.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..7a4789e --- /dev/null +++ b/codecov.yml @@ -0,0 +1,11 @@ +ignore: + - "libsqlite3-sys/bindgen-bindings" + - "libsqlite3-sys/sqlite3" +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true From 1b8c3056e6a015949896ca20815719930ec48051 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:21:57 -0700 Subject: [PATCH 02/73] Merge another codecov --- codecov.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/codecov.yml b/codecov.yml index 7a4789e..7b19db2 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,11 +1,17 @@ -ignore: - - "libsqlite3-sys/bindgen-bindings" - - "libsqlite3-sys/sqlite3" coverage: + range: 70..100 + round: down + precision: 2 status: project: default: - informational: true - patch: - default: - informational: true + threshold: 2% + +# Tests aren't important for coverage +ignore: + - "tests" + +# Make less noisy comments +comment: + layout: "files" + require_changes: yes From 7f34f791c0a5c3f2c2ce2ed7e43ff12ed123c62c Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:22:18 -0700 Subject: [PATCH 03/73] Merge another codecov --- codecov.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index 7b19db2..7864a9e 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,13 +1,14 @@ +# Hold ourselves to a high bar coverage: - range: 70..100 + range: 85..100 round: down precision: 2 status: project: default: - threshold: 2% + threshold: 1% -# Tests aren't important for coverage +# Test files aren't important for coverage ignore: - "tests" From 510b69615dd47cb63584976512cb95b265cb22bf Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:23:03 -0700 Subject: [PATCH 04/73] Merge another codecov --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 7864a9e..1e0fb06 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,7 +2,7 @@ coverage: range: 85..100 round: down - precision: 2 + precision: 1 status: project: default: From b32648cabb5862b0814ab0abd6d5c81498758270 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:24:02 -0700 Subject: [PATCH 05/73] Merge another codecov --- codecov.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index 1e0fb06..ff4f571 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,18 +1,21 @@ -# Hold ourselves to a high bar +# ref: https://docs.codecov.com/docs/codecovyml-reference coverage: + # Hold ourselves to a high bar range: 85..100 round: down precision: 1 status: + # ref: https://docs.codecov.com/docs/commit-status project: default: + # Avoid false negatives threshold: 1% # Test files aren't important for coverage ignore: - "tests" -# Make less noisy comments +# Make comments less noisy comment: layout: "files" require_changes: yes From 126c9a3a35d5ac428c22883d36f0aac69d2e20e9 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:25:23 -0700 Subject: [PATCH 06/73] Place codecov config under .github --- codecov.yml => github/codecov.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codecov.yml => github/codecov.yml (100%) diff --git a/codecov.yml b/github/codecov.yml similarity index 100% rename from codecov.yml rename to github/codecov.yml From 11027d3f75ced20536b99225edccf34f286dd4e0 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:27:27 -0700 Subject: [PATCH 07/73] Add (only) ASAN workflow --- github/workflows/asan.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 github/workflows/asan.yml diff --git a/github/workflows/asan.yml b/github/workflows/asan.yml new file mode 100644 index 0000000..08afae9 --- /dev/null +++ b/github/workflows/asan.yml @@ -0,0 +1,24 @@ +on: + push: + branches: [main] + pull_request: +name: Address sanitizer +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions/checkout@v2 + - name: cargo test -Zsanitizer=address + uses: actions-rs/cargo@v1 + with: + command: test + # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 + args: --lib --tests --all-features --target x86_64-unknown-linux-gnu + env: + ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" + RUSTFLAGS: "-Z sanitizer=address" From bbdbd96ec709e3cc83a081cf821fdfffce85ecb5 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:27:38 -0700 Subject: [PATCH 08/73] Add first coverage workflow --- github/workflows/coverage.yml | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 github/workflows/coverage.yml diff --git a/github/workflows/coverage.yml b/github/workflows/coverage.yml new file mode 100644 index 0000000..6effa8c --- /dev/null +++ b/github/workflows/coverage.yml @@ -0,0 +1,66 @@ +on: + push: + branches: [master] + paths-ignore: + - 'build_doc.sh' + - 'check.sh' + - 'run_ci_tests.sh' + - 'start_sshd.sh' + - 'stop_sshd.sh' + pull_request: + paths-ignore: + - 'build_doc.sh' + - 'check.sh' + - 'run_ci_tests.sh' + - 'start_sshd.sh' + - 'stop_sshd.sh' +name: coverage +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - run: | + # Wait for startup of openssh-server + timeout 15 ./wait_for_sshd_start_up.sh + chmod 600 .test-key + mkdir /tmp/openssh-rs + ssh -i .test-key -v -p 2222 -l test-user localhost -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/openssh-rs/known_hosts whoami + name: Test ssh connectivity + - run: | + eval $(ssh-agent) + echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV + echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV + cat .test-key | ssh-add - + name: Set up ssh-agent + - name: Generate code coverage + run: cargo llvm-cov --all-features --lcov --output-path lcov.info + env: + # makes all the ignored tests not ignored + RUSTFLAGS: --cfg=ci + # we cannot use 127.0.0.1 (the default here) + # since we are running from a different container + TEST_HOST: ssh://test-user@localhost:2222 + XDG_RUNTIME_DIR: /tmp + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true + services: + openssh: + image: linuxserver/openssh-server:amd64-latest + ports: + - 2222:2222 + env: + USER_NAME: test-user + PUBLIC_KEY: |- + ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzHvK2pKtSlZXP9tPYOOBb/xn0IiC9iLMS355AYUPC7 + DOCKER_MODS: linuxserver/mods:openssh-server-ssh-tunnel From fe6ba380bd39c665e9d9a2153b2dc5287fe25cae Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:29:55 -0700 Subject: [PATCH 09/73] Merge another coverage.yml --- github/workflows/coverage.yml | 42 ----------------------------------- 1 file changed, 42 deletions(-) diff --git a/github/workflows/coverage.yml b/github/workflows/coverage.yml index 6effa8c..f07bde1 100644 --- a/github/workflows/coverage.yml +++ b/github/workflows/coverage.yml @@ -1,19 +1,7 @@ on: push: branches: [master] - paths-ignore: - - 'build_doc.sh' - - 'check.sh' - - 'run_ci_tests.sh' - - 'start_sshd.sh' - - 'stop_sshd.sh' pull_request: - paths-ignore: - - 'build_doc.sh' - - 'check.sh' - - 'run_ci_tests.sh' - - 'start_sshd.sh' - - 'stop_sshd.sh' name: coverage jobs: test: @@ -28,39 +16,9 @@ jobs: components: llvm-tools-preview - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - - run: | - # Wait for startup of openssh-server - timeout 15 ./wait_for_sshd_start_up.sh - chmod 600 .test-key - mkdir /tmp/openssh-rs - ssh -i .test-key -v -p 2222 -l test-user localhost -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=/tmp/openssh-rs/known_hosts whoami - name: Test ssh connectivity - - run: | - eval $(ssh-agent) - echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV - echo "SSH_AGENT_PID=$SSH_AGENT_PID" >> $GITHUB_ENV - cat .test-key | ssh-add - - name: Set up ssh-agent - name: Generate code coverage run: cargo llvm-cov --all-features --lcov --output-path lcov.info - env: - # makes all the ignored tests not ignored - RUSTFLAGS: --cfg=ci - # we cannot use 127.0.0.1 (the default here) - # since we are running from a different container - TEST_HOST: ssh://test-user@localhost:2222 - XDG_RUNTIME_DIR: /tmp - name: Upload to codecov.io uses: codecov/codecov-action@v2 with: fail_ci_if_error: true - services: - openssh: - image: linuxserver/openssh-server:amd64-latest - ports: - - 2222:2222 - env: - USER_NAME: test-user - PUBLIC_KEY: |- - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGzHvK2pKtSlZXP9tPYOOBb/xn0IiC9iLMS355AYUPC7 - DOCKER_MODS: linuxserver/mods:openssh-server-ssh-tunnel From 1fe2a6d008275efaff56200b8fba5ecc252aa970 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:31:17 -0700 Subject: [PATCH 10/73] Merge another coverage.yml --- github/workflows/coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/workflows/coverage.yml b/github/workflows/coverage.yml index f07bde1..677ad58 100644 --- a/github/workflows/coverage.yml +++ b/github/workflows/coverage.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: true - uses: actions-rs/toolchain@v1 with: profile: minimal From 225ad3978688c093f4670ec04352d465076f39d3 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:31:58 -0700 Subject: [PATCH 11/73] Add first features workflow --- github/workflows/features.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 github/workflows/features.yml diff --git a/github/workflows/features.yml b/github/workflows/features.yml new file mode 100644 index 0000000..2d8c1fe --- /dev/null +++ b/github/workflows/features.yml @@ -0,0 +1,27 @@ +on: + push: + branches: [master] + pull_request: +name: cargo hack +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + with: + submodules: true + - name: Install cargo-hack + uses: actions-rs/install@v0.1 + with: + crate: cargo-hack + version: latest + use-tool-cache: true + - name: cargo hack + uses: actions-rs/cargo@v1 + with: + command: hack + args: --feature-powerset --exclude-no-default-features check From 922692a2977a4c93786a0ecbe11fc01501361aad Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:32:32 -0700 Subject: [PATCH 12/73] Merge another features workflow --- github/workflows/features.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/workflows/features.yml b/github/workflows/features.yml index 2d8c1fe..f6acf15 100644 --- a/github/workflows/features.yml +++ b/github/workflows/features.yml @@ -24,4 +24,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: hack - args: --feature-powerset --exclude-no-default-features check + args: --feature-powerset check From 043eb24611b5272a04082d63566837a9efbc71e9 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:32:58 -0700 Subject: [PATCH 13/73] Merge another features workflow --- github/workflows/features.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/workflows/features.yml b/github/workflows/features.yml index f6acf15..d9ca4c0 100644 --- a/github/workflows/features.yml +++ b/github/workflows/features.yml @@ -24,4 +24,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: hack - args: --feature-powerset check + args: --feature-powerset check --all-targets From d8c8a99dea99b437eefc56e5b873a863a4446c51 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:33:48 -0700 Subject: [PATCH 14/73] Merge another features workflow --- github/workflows/features.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/github/workflows/features.yml b/github/workflows/features.yml index d9ca4c0..c2c3920 100644 --- a/github/workflows/features.yml +++ b/github/workflows/features.yml @@ -15,11 +15,7 @@ jobs: with: submodules: true - name: Install cargo-hack - uses: actions-rs/install@v0.1 - with: - crate: cargo-hack - version: latest - use-tool-cache: true + uses: taiki-e/install-action@cargo-hack - name: cargo hack uses: actions-rs/cargo@v1 with: From f67cad0f915deebcdf7ceb89ffdd0925bc910153 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:34:34 -0700 Subject: [PATCH 15/73] Add (only) loom workflow --- github/workflows/loom.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 github/workflows/loom.yml diff --git a/github/workflows/loom.yml b/github/workflows/loom.yml new file mode 100644 index 0000000..9246b40 --- /dev/null +++ b/github/workflows/loom.yml @@ -0,0 +1,22 @@ +on: + push: + branches: [main] + pull_request: +name: Loom +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + - uses: actions/checkout@v2 + - name: cargo test --test loom + uses: actions-rs/cargo@v1 + with: + command: test + args: --release --test loom + env: + LOOM_MAX_PREEMPTIONS: 2 + RUSTFLAGS: "--cfg loom" From bf66d94f15b7288f417cfae0eab6542e2e100daf Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:34:43 -0700 Subject: [PATCH 16/73] Add (only) LSAN workflow --- github/workflows/lsan.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 github/workflows/lsan.yml diff --git a/github/workflows/lsan.yml b/github/workflows/lsan.yml new file mode 100644 index 0000000..69ce0df --- /dev/null +++ b/github/workflows/lsan.yml @@ -0,0 +1,32 @@ +on: + push: + branches: [main] + pull_request: +name: Leak sanitizer +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - uses: actions/checkout@v2 + - run: | + # to get the symbolizer for debug symbol resolution + sudo apt install llvm + # to fix buggy leak analyzer: + # https://github.com/japaric/rust-san#unrealiable-leaksanitizer + sed -i '/\[features\]/i [profile.dev]' Cargo.toml + sed -i '/profile.dev/a opt-level = 1' Cargo.toml + cat Cargo.toml + name: Enable debug symbols + - name: cargo test -Zsanitizer=leak + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --target x86_64-unknown-linux-gnu + env: + RUSTFLAGS: "-Z sanitizer=leak" + LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" From c65a7c4f87be9ddea9e34eb254f3b6d5933db4ef Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:35:09 -0700 Subject: [PATCH 17/73] Add first minial workflow --- github/workflows/minimal.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 github/workflows/minimal.yml diff --git a/github/workflows/minimal.yml b/github/workflows/minimal.yml new file mode 100644 index 0000000..b4cf571 --- /dev/null +++ b/github/workflows/minimal.yml @@ -0,0 +1,31 @@ +on: + push: + branches: [master] + pull_request: +name: With dependencies at minimal versions +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + with: + submodules: true + - name: cargo update -Zminimal-versions + uses: actions-rs/cargo@v1 + with: + command: update + toolchain: nightly + args: -Zminimal-versions + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --all-targets From 77079d77cb4aa288bda667917667cfaee87bd361 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:36:29 -0700 Subject: [PATCH 18/73] Add (only) miri workflow --- github/workflows/miri.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 github/workflows/miri.yml diff --git a/github/workflows/miri.yml b/github/workflows/miri.yml new file mode 100644 index 0000000..e79ab42 --- /dev/null +++ b/github/workflows/miri.yml @@ -0,0 +1,25 @@ +on: + push: + branches: [main] + pull_request: +name: Miri +jobs: + test: + runs-on: ubuntu-latest + steps: + - run: | + echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.NIGHTLY }} + override: true + components: miri + - uses: actions/checkout@v2 + - name: cargo miri test + uses: actions-rs/cargo@v1 + with: + command: miri + args: test + env: + MIRIFLAGS: "-Zmiri-tag-raw-pointers" From 9b48ae326374d8d8609a65649026fa09f8a68c7f Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:36:43 -0700 Subject: [PATCH 19/73] Add first msrv workflow --- github/workflows/msrv.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 github/workflows/msrv.yml diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml new file mode 100644 index 0000000..aebe1f8 --- /dev/null +++ b/github/workflows/msrv.yml @@ -0,0 +1,19 @@ +on: + push: + branches: [master] + pull_request: +name: Minimum Supported Rust Version +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.48.0 # nom 7 + override: true + - uses: actions/checkout@v2 + - name: cargo +1.48.0 check + uses: actions-rs/cargo@v1 + with: + command: check From b60aa5589ac569446a5128453983dee9bb504666 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:37:03 -0700 Subject: [PATCH 20/73] Merge another msrv workflow --- github/workflows/msrv.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml index aebe1f8..ee1b2bf 100644 --- a/github/workflows/msrv.yml +++ b/github/workflows/msrv.yml @@ -10,10 +10,10 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.48.0 # nom 7 + toolchain: 1.56.0 # 2021 edition requires 1.56 override: true - uses: actions/checkout@v2 - - name: cargo +1.48.0 check + - name: cargo +1.56.0 check uses: actions-rs/cargo@v1 with: command: check From 1113c895d862ce860c82596cac973ad075ef1ac6 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:37:31 -0700 Subject: [PATCH 21/73] Merge another msrv workflow --- github/workflows/msrv.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml index ee1b2bf..4a3a92e 100644 --- a/github/workflows/msrv.yml +++ b/github/workflows/msrv.yml @@ -10,10 +10,10 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.56.0 # 2021 edition requires 1.56 + toolchain: 1.56.1 # 2021 edition requires 1.56 override: true - uses: actions/checkout@v2 - - name: cargo +1.56.0 check + - name: cargo +1.56.1 check uses: actions-rs/cargo@v1 with: command: check From e6ef8e3166b93c22af938872a547e104f2601587 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:38:01 -0700 Subject: [PATCH 22/73] Merge another msrv workflow --- github/workflows/msrv.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml index 4a3a92e..ac0dc41 100644 --- a/github/workflows/msrv.yml +++ b/github/workflows/msrv.yml @@ -13,6 +13,8 @@ jobs: toolchain: 1.56.1 # 2021 edition requires 1.56 override: true - uses: actions/checkout@v2 + with: + submodules: true - name: cargo +1.56.1 check uses: actions-rs/cargo@v1 with: From c74ee968a1aafec9e839dee907f0137e6356feff Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:38:56 -0700 Subject: [PATCH 23/73] Add (only) no-std workflow --- github/workflows/nostd.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 github/workflows/nostd.yml diff --git a/github/workflows/nostd.yml b/github/workflows/nostd.yml new file mode 100644 index 0000000..433e11d --- /dev/null +++ b/github/workflows/nostd.yml @@ -0,0 +1,24 @@ +on: + push: + branches: [main] + pull_request: +name: no-std +jobs: + nostd: + runs-on: ubuntu-latest + name: ${{ matrix.target }} + strategy: + matrix: + target: [thumbv7m-none-eabi, aarch64-unknown-none] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: ${{ matrix.target }} + - uses: actions/checkout@v2 + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --target ${{ matrix.target }} --no-default-features From 92379c862376607f7caca04e470c09671922f238 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:39:09 -0700 Subject: [PATCH 24/73] Add first os-check workflow --- github/workflows/os-check.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 github/workflows/os-check.yml diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml new file mode 100644 index 0000000..bbcb475 --- /dev/null +++ b/github/workflows/os-check.yml @@ -0,0 +1,24 @@ +on: + push: + branches: [master] + pull_request: +name: cargo check +jobs: + os-check: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v2 + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all-features --all-targets From 05dd4680bf90603c70cb7cd406299675441fe59d Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:39:59 -0700 Subject: [PATCH 25/73] Merge another os-check workflow --- github/workflows/os-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml index bbcb475..285499b 100644 --- a/github/workflows/os-check.yml +++ b/github/workflows/os-check.yml @@ -2,7 +2,7 @@ on: push: branches: [master] pull_request: -name: cargo check +name: os check jobs: os-check: runs-on: ${{ matrix.os }} @@ -17,8 +17,8 @@ jobs: profile: minimal toolchain: stable - uses: actions/checkout@v2 - - name: cargo check + - name: cargo test uses: actions-rs/cargo@v1 with: - command: check + command: test args: --all-features --all-targets From bc3f55118617b5ffe1ea479c4f6d7d2167b86d36 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:40:29 -0700 Subject: [PATCH 26/73] Add first style workflow --- github/workflows/style.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 github/workflows/style.yml diff --git a/github/workflows/style.yml b/github/workflows/style.yml new file mode 100644 index 0000000..74a877c --- /dev/null +++ b/github/workflows/style.yml @@ -0,0 +1,36 @@ +on: + push: + branches: [main] + pull_request: +name: lint +jobs: + style: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} + strategy: + fail-fast: false + matrix: + toolchain: [stable, beta] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + - uses: actions/checkout@v2 + - name: cargo fmt --check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + - name: cargo doc + uses: actions-rs/cargo@v1 + if: always() + with: + command: doc + args: --no-deps --all-features + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} From fe460400ed2259af7e17f5ff51742137623e9e8e Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:41:00 -0700 Subject: [PATCH 27/73] Merge another style workflow --- github/workflows/style.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/github/workflows/style.yml b/github/workflows/style.yml index 74a877c..d3320bc 100644 --- a/github/workflows/style.yml +++ b/github/workflows/style.yml @@ -23,14 +23,24 @@ jobs: with: command: fmt args: --check - - name: cargo doc - uses: actions-rs/cargo@v1 - if: always() - with: - command: doc - args: --no-deps --all-features - name: cargo clippy uses: actions-rs/clippy-check@v1 if: always() with: token: ${{ secrets.GITHUB_TOKEN }} + doc: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions/checkout@v2 + - name: cargo doc + uses: actions-rs/cargo@v1 + with: + toolchain: nightly + command: doc + args: --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs From 3bd8b12ec08910b2609cdfc843474d5b83ff7dbc Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:41:57 -0700 Subject: [PATCH 28/73] Merge another style workflow --- github/workflows/style.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/workflows/style.yml b/github/workflows/style.yml index d3320bc..648b6a1 100644 --- a/github/workflows/style.yml +++ b/github/workflows/style.yml @@ -18,6 +18,8 @@ jobs: toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - uses: actions/checkout@v2 + with: + submodules: true - name: cargo fmt --check uses: actions-rs/cargo@v1 with: From 8953a88abecc66ea7811766b46aff6a5fd767124 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:42:10 -0700 Subject: [PATCH 29/73] Add first test workflow --- github/workflows/test.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 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..a82ac61 --- /dev/null +++ b/github/workflows/test.yml @@ -0,0 +1,29 @@ +on: + push: + branches: [master] + pull_request: +name: cargo test +jobs: + test: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} / ${{ matrix.toolchain }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + toolchain: [stable] + include: + - os: ubuntu-latest + toolchain: beta + - os: ubuntu-latest + toolchain: nightly + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + - uses: actions/checkout@v2 + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test From 0910d977fc68082220d493bef07bc9d5f2265fc7 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:42:25 -0700 Subject: [PATCH 30/73] Merge another test workflow --- github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/github/workflows/test.yml b/github/workflows/test.yml index a82ac61..5dd762c 100644 --- a/github/workflows/test.yml +++ b/github/workflows/test.yml @@ -27,3 +27,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + args: --all-features From 971c3fd9eb5f7d80088caaf5647a74b82d40b860 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:42:52 -0700 Subject: [PATCH 31/73] Merge another test workflow --- github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github/workflows/test.yml b/github/workflows/test.yml index 5dd762c..de5d3ea 100644 --- a/github/workflows/test.yml +++ b/github/workflows/test.yml @@ -23,8 +23,10 @@ jobs: profile: minimal toolchain: ${{ matrix.toolchain }} - uses: actions/checkout@v2 + with: + submodules: true - name: cargo test uses: actions-rs/cargo@v1 with: command: test - args: --all-features + args: --all-features --all-targets From 2de2235ad3803a978e150fca8d38182eb6ed7a9e Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:46:13 -0700 Subject: [PATCH 32/73] Merge another test workflow --- github/workflows/test.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/github/workflows/test.yml b/github/workflows/test.yml index de5d3ea..b247ef6 100644 --- a/github/workflows/test.yml +++ b/github/workflows/test.yml @@ -5,24 +5,17 @@ on: name: cargo test jobs: test: - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} / ${{ matrix.toolchain }} + runs-on: ubuntu-latest + name: ubuntu / ${{ matrix.toolchain }} strategy: - fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - toolchain: [stable] - include: - - os: ubuntu-latest - toolchain: beta - - os: ubuntu-latest - toolchain: nightly + toolchain: [stable, beta, nightly] steps: - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: cargo test From 0f90a0b77958b3978b6be3997a09ea5cb9b1bd6b Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:47:38 -0700 Subject: [PATCH 33/73] Make everything use checkout@v3 --- github/workflows/asan.yml | 2 +- github/workflows/features.yml | 2 +- github/workflows/loom.yml | 2 +- github/workflows/lsan.yml | 2 +- github/workflows/minimal.yml | 2 +- github/workflows/miri.yml | 2 +- github/workflows/msrv.yml | 2 +- github/workflows/nostd.yml | 2 +- github/workflows/os-check.yml | 2 +- github/workflows/style.yml | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/github/workflows/asan.yml b/github/workflows/asan.yml index 08afae9..5604b7e 100644 --- a/github/workflows/asan.yml +++ b/github/workflows/asan.yml @@ -12,7 +12,7 @@ jobs: profile: minimal toolchain: nightly override: true - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo test -Zsanitizer=address uses: actions-rs/cargo@v1 with: diff --git a/github/workflows/features.yml b/github/workflows/features.yml index c2c3920..3e45d18 100644 --- a/github/workflows/features.yml +++ b/github/workflows/features.yml @@ -11,7 +11,7 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: Install cargo-hack diff --git a/github/workflows/loom.yml b/github/workflows/loom.yml index 9246b40..8cfe45d 100644 --- a/github/workflows/loom.yml +++ b/github/workflows/loom.yml @@ -11,7 +11,7 @@ jobs: with: toolchain: stable profile: minimal - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo test --test loom uses: actions-rs/cargo@v1 with: diff --git a/github/workflows/lsan.yml b/github/workflows/lsan.yml index 69ce0df..a966913 100644 --- a/github/workflows/lsan.yml +++ b/github/workflows/lsan.yml @@ -12,7 +12,7 @@ jobs: profile: minimal toolchain: nightly override: true - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: | # to get the symbolizer for debug symbol resolution sudo apt install llvm diff --git a/github/workflows/minimal.yml b/github/workflows/minimal.yml index b4cf571..f3ed6ac 100644 --- a/github/workflows/minimal.yml +++ b/github/workflows/minimal.yml @@ -15,7 +15,7 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: cargo update -Zminimal-versions diff --git a/github/workflows/miri.yml b/github/workflows/miri.yml index e79ab42..ae9539a 100644 --- a/github/workflows/miri.yml +++ b/github/workflows/miri.yml @@ -15,7 +15,7 @@ jobs: toolchain: ${{ env.NIGHTLY }} override: true components: miri - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo miri test uses: actions-rs/cargo@v1 with: diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml index ac0dc41..9758e26 100644 --- a/github/workflows/msrv.yml +++ b/github/workflows/msrv.yml @@ -12,7 +12,7 @@ jobs: profile: minimal toolchain: 1.56.1 # 2021 edition requires 1.56 override: true - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: cargo +1.56.1 check diff --git a/github/workflows/nostd.yml b/github/workflows/nostd.yml index 433e11d..409ae73 100644 --- a/github/workflows/nostd.yml +++ b/github/workflows/nostd.yml @@ -16,7 +16,7 @@ jobs: profile: minimal toolchain: stable target: ${{ matrix.target }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo check uses: actions-rs/cargo@v1 with: diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml index 285499b..5fc3453 100644 --- a/github/workflows/os-check.yml +++ b/github/workflows/os-check.yml @@ -16,7 +16,7 @@ jobs: with: profile: minimal toolchain: stable - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo test uses: actions-rs/cargo@v1 with: diff --git a/github/workflows/style.yml b/github/workflows/style.yml index 648b6a1..7a583f2 100644 --- a/github/workflows/style.yml +++ b/github/workflows/style.yml @@ -17,7 +17,7 @@ jobs: profile: minimal toolchain: ${{ matrix.toolchain }} components: rustfmt, clippy - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - name: cargo fmt --check @@ -37,7 +37,7 @@ jobs: with: profile: minimal toolchain: nightly - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: cargo doc uses: actions-rs/cargo@v1 with: From 99ddee84ab05f5d5f37ad30a31d18dd7c72050c9 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:47:57 -0700 Subject: [PATCH 34/73] Standardize on 'main' as branch name --- github/workflows/coverage.yml | 2 +- github/workflows/features.yml | 2 +- github/workflows/minimal.yml | 2 +- github/workflows/msrv.yml | 2 +- github/workflows/os-check.yml | 2 +- github/workflows/test.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/github/workflows/coverage.yml b/github/workflows/coverage.yml index 677ad58..375f7a3 100644 --- a/github/workflows/coverage.yml +++ b/github/workflows/coverage.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: coverage jobs: diff --git a/github/workflows/features.yml b/github/workflows/features.yml index 3e45d18..ac5e18e 100644 --- a/github/workflows/features.yml +++ b/github/workflows/features.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: cargo hack jobs: diff --git a/github/workflows/minimal.yml b/github/workflows/minimal.yml index f3ed6ac..0a558a9 100644 --- a/github/workflows/minimal.yml +++ b/github/workflows/minimal.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: With dependencies at minimal versions jobs: diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml index 9758e26..d6d9046 100644 --- a/github/workflows/msrv.yml +++ b/github/workflows/msrv.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: Minimum Supported Rust Version jobs: diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml index 5fc3453..c56b699 100644 --- a/github/workflows/os-check.yml +++ b/github/workflows/os-check.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: os check jobs: diff --git a/github/workflows/test.yml b/github/workflows/test.yml index b247ef6..dfc1819 100644 --- a/github/workflows/test.yml +++ b/github/workflows/test.yml @@ -1,6 +1,6 @@ on: push: - branches: [master] + branches: [main] pull_request: name: cargo test jobs: From 87365663b1f49c88c2a3642fece0b2a932001355 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 16:19:55 -0700 Subject: [PATCH 35/73] Missed a submodule checkout --- github/workflows/os-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml index c56b699..db3590b 100644 --- a/github/workflows/os-check.yml +++ b/github/workflows/os-check.yml @@ -17,6 +17,8 @@ jobs: profile: minimal toolchain: stable - uses: actions/checkout@v3 + with: + submodules: true - name: cargo test uses: actions-rs/cargo@v1 with: From 4859c128823805015dc164d58316dc5b25a69264 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 18:16:21 -0700 Subject: [PATCH 36/73] Add TODOs from twitter thread --- github/workflows/locked.yml | 2 ++ github/workflows/scheduled-nightly.yml | 1 + 2 files changed, 3 insertions(+) create mode 100644 github/workflows/locked.yml create mode 100644 github/workflows/scheduled-nightly.yml diff --git a/github/workflows/locked.yml b/github/workflows/locked.yml new file mode 100644 index 0000000..c67a317 --- /dev/null +++ b/github/workflows/locked.yml @@ -0,0 +1,2 @@ +# TODO: https://twitter.com/jonhoo/status/1571290371124260865 +# Maybe also: https://twitter.com/alcuadrado/status/1571291687837732873 diff --git a/github/workflows/scheduled-nightly.yml b/github/workflows/scheduled-nightly.yml new file mode 100644 index 0000000..5a86cca --- /dev/null +++ b/github/workflows/scheduled-nightly.yml @@ -0,0 +1 @@ +# TODO: https://twitter.com/mycoliza/status/1571295690063753218 From afa25312c9c6cf8748629bd3a5c054a688785dfc Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 11:29:34 -0700 Subject: [PATCH 37/73] Practice what you preach --- github/workflows/check.yml | 107 +++++++++++++++++++++++++ github/workflows/coverage.yml | 26 ------ github/workflows/features.yml | 23 ------ github/workflows/locked.yml | 2 - github/workflows/minimal.yml | 31 ------- github/workflows/msrv.yml | 21 ----- github/workflows/os-check.yml | 26 ------ github/workflows/scheduled-nightly.yml | 1 - github/workflows/scheduled.yml | 61 ++++++++++++++ github/workflows/style.yml | 48 ----------- github/workflows/test.yml | 98 ++++++++++++++++++++-- 11 files changed, 261 insertions(+), 183 deletions(-) create mode 100644 github/workflows/check.yml delete mode 100644 github/workflows/coverage.yml delete mode 100644 github/workflows/features.yml delete mode 100644 github/workflows/locked.yml delete mode 100644 github/workflows/minimal.yml delete mode 100644 github/workflows/msrv.yml delete mode 100644 github/workflows/os-check.yml delete mode 100644 github/workflows/scheduled-nightly.yml create mode 100644 github/workflows/scheduled.yml delete mode 100644 github/workflows/style.yml diff --git a/github/workflows/check.yml b/github/workflows/check.yml new file mode 100644 index 0000000..81c3a01 --- /dev/null +++ b/github/workflows/check.yml @@ -0,0 +1,107 @@ +on: + push: + branches: [main] + pull_request: +name: check +jobs: + fmt: + runs-on: ubuntu-latest + name: stable / fmt + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + - name: cargo fmt --check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + clippy: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} / clippy + strategy: + fail-fast: false + matrix: + toolchain: [stable, beta] + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + default: true + components: clippy + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + doc: + runs-on: ubuntu-latest + name: nightly / doc + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + default: true + - name: cargo doc + uses: actions-rs/cargo@v1 + with: + command: doc + args: --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs + hack: + runs-on: ubuntu-latest + name: ubuntu / stable / features + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: cargo install cargo-hack + uses: taiki-e/install-action@cargo-hack + - name: cargo hack + uses: actions-rs/cargo@v1 + with: + command: hack + args: --feature-powerset check --all-targets + msrv: + runs-on: ubuntu-latest + # we use a matrix here just because env can't be used in job names + # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability + strategy: + matrix: + msrv: [1.56.1] # 2021 edition requires 1.56 + name: ubuntu / ${{ matrix.msrv }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.msrv }} + default: true + - name: cargo +${{ matrix.msrv }} check + uses: actions-rs/cargo@v1 + with: + command: check diff --git a/github/workflows/coverage.yml b/github/workflows/coverage.yml deleted file mode 100644 index 375f7a3..0000000 --- a/github/workflows/coverage.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: coverage -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: llvm-tools-preview - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: Generate code coverage - run: cargo llvm-cov --all-features --lcov --output-path lcov.info - - name: Upload to codecov.io - uses: codecov/codecov-action@v2 - with: - fail_ci_if_error: true diff --git a/github/workflows/features.yml b/github/workflows/features.yml deleted file mode 100644 index ac5e18e..0000000 --- a/github/workflows/features.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: cargo hack -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 - with: - submodules: true - - name: Install cargo-hack - uses: taiki-e/install-action@cargo-hack - - name: cargo hack - uses: actions-rs/cargo@v1 - with: - command: hack - args: --feature-powerset check --all-targets diff --git a/github/workflows/locked.yml b/github/workflows/locked.yml deleted file mode 100644 index c67a317..0000000 --- a/github/workflows/locked.yml +++ /dev/null @@ -1,2 +0,0 @@ -# TODO: https://twitter.com/jonhoo/status/1571290371124260865 -# Maybe also: https://twitter.com/alcuadrado/status/1571291687837732873 diff --git a/github/workflows/minimal.yml b/github/workflows/minimal.yml deleted file mode 100644 index 0a558a9..0000000 --- a/github/workflows/minimal.yml +++ /dev/null @@ -1,31 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: With dependencies at minimal versions -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 - with: - submodules: true - - name: cargo update -Zminimal-versions - uses: actions-rs/cargo@v1 - with: - command: update - toolchain: nightly - args: -Zminimal-versions - - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --all-targets diff --git a/github/workflows/msrv.yml b/github/workflows/msrv.yml deleted file mode 100644 index d6d9046..0000000 --- a/github/workflows/msrv.yml +++ /dev/null @@ -1,21 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Minimum Supported Rust Version -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.56.1 # 2021 edition requires 1.56 - override: true - - uses: actions/checkout@v3 - with: - submodules: true - - name: cargo +1.56.1 check - uses: actions-rs/cargo@v1 - with: - command: check diff --git a/github/workflows/os-check.yml b/github/workflows/os-check.yml deleted file mode 100644 index db3590b..0000000 --- a/github/workflows/os-check.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: os check -jobs: - os-check: - runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-latest, windows-latest] - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - uses: actions/checkout@v3 - with: - submodules: true - - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --all-targets diff --git a/github/workflows/scheduled-nightly.yml b/github/workflows/scheduled-nightly.yml deleted file mode 100644 index 5a86cca..0000000 --- a/github/workflows/scheduled-nightly.yml +++ /dev/null @@ -1 +0,0 @@ -# TODO: https://twitter.com/mycoliza/status/1571295690063753218 diff --git a/github/workflows/scheduled.yml b/github/workflows/scheduled.yml new file mode 100644 index 0000000..bb39a22 --- /dev/null +++ b/github/workflows/scheduled.yml @@ -0,0 +1,61 @@ +on: + push: + branches: [main] + pull_request: + schedule: + - cron: '7 7 * * *' +name: cargo test (rolling) +jobs: + # https://twitter.com/mycoliza/status/1571295690063753218 + nightly: + runs-on: ubuntu-latest + name: ubuntu / nightly + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + default: true + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: cargo test --locked + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --all-features --all-targets + # https://twitter.com/alcuadrado/status/1571291687837732873 + update: + runs-on: ubuntu-latest + name: ubuntu / stable / updated + # There's no point running this if no Cargo.lock was checked in in the + # first place, since we'd just redo what happened in the regular test job. + # Unfortunately, hashFiles only works in if on steps, so we reepeat it. + # if: hashFiles('Cargo.lock') != '' + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + if: hashFiles('Cargo.lock') != '' + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: cargo update + if: hashFiles('Cargo.lock') != '' + uses: actions-rs/cargo@v1 + with: + command: update + - name: cargo test + if: hashFiles('Cargo.lock') != '' + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --all-features --all-targets diff --git a/github/workflows/style.yml b/github/workflows/style.yml deleted file mode 100644 index 7a583f2..0000000 --- a/github/workflows/style.yml +++ /dev/null @@ -1,48 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: lint -jobs: - style: - runs-on: ubuntu-latest - name: ${{ matrix.toolchain }} - strategy: - fail-fast: false - matrix: - toolchain: [stable, beta] - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.toolchain }} - components: rustfmt, clippy - - uses: actions/checkout@v3 - with: - submodules: true - - name: cargo fmt --check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check - - name: cargo clippy - uses: actions-rs/clippy-check@v1 - if: always() - with: - token: ${{ secrets.GITHUB_TOKEN }} - doc: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - - uses: actions/checkout@v3 - - name: cargo doc - uses: actions-rs/cargo@v1 - with: - toolchain: nightly - command: doc - args: --no-deps --all-features - env: - RUSTDOCFLAGS: --cfg docsrs diff --git a/github/workflows/test.yml b/github/workflows/test.yml index dfc1819..83645f8 100644 --- a/github/workflows/test.yml +++ b/github/workflows/test.yml @@ -2,24 +2,112 @@ on: push: branches: [main] pull_request: -name: cargo test +name: test jobs: - test: + required: runs-on: ubuntu-latest name: ubuntu / ${{ matrix.toolchain }} strategy: matrix: - toolchain: [stable, beta, nightly] + toolchain: [stable, beta] steps: - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install ${{ matrix.toolchain }} + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} + default: true + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + # https://twitter.com/jonhoo/status/1571290371124260865 + - name: cargo test --locked + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --all-features --all-targets + minimal: + runs-on: ubuntu-latest + name: ubuntu / stable / minimal-versions + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Install nightly for -Zminimal-versions + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - name: cargo update -Zminimal-versions + uses: actions-rs/cargo@v1 + with: + command: update + toolchain: nightly + args: -Zminimal-versions + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --all-features --all-targets + os-check: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} / stable + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: - uses: actions/checkout@v3 with: submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile - name: cargo test uses: actions-rs/cargo@v1 with: command: test - args: --all-features --all-targets + args: --locked --all-features --all-targets + coverage: + runs-on: ubuntu-latest + name: ubuntu / stable / coverage + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: llvm-tools-preview + - name: cargo install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: cargo generate-lockfile + if: hashFiles('Cargo.lock') == '' + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: cargo llvm-cov + run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true From 71c2048cc0017a84a294be69d3b1629f55b1c8f0 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 11:44:55 -0700 Subject: [PATCH 38/73] mv github .github This should make it possible to have rust-ci-conf as a remote you merge from. --- {github => .github}/codecov.yml | 0 {github => .github}/workflows/asan.yml | 0 {github => .github}/workflows/check.yml | 0 {github => .github}/workflows/loom.yml | 0 {github => .github}/workflows/lsan.yml | 0 {github => .github}/workflows/miri.yml | 0 {github => .github}/workflows/nostd.yml | 0 {github => .github}/workflows/scheduled.yml | 0 {github => .github}/workflows/test.yml | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename {github => .github}/codecov.yml (100%) rename {github => .github}/workflows/asan.yml (100%) rename {github => .github}/workflows/check.yml (100%) rename {github => .github}/workflows/loom.yml (100%) rename {github => .github}/workflows/lsan.yml (100%) rename {github => .github}/workflows/miri.yml (100%) rename {github => .github}/workflows/nostd.yml (100%) rename {github => .github}/workflows/scheduled.yml (100%) rename {github => .github}/workflows/test.yml (100%) diff --git a/github/codecov.yml b/.github/codecov.yml similarity index 100% rename from github/codecov.yml rename to .github/codecov.yml diff --git a/github/workflows/asan.yml b/.github/workflows/asan.yml similarity index 100% rename from github/workflows/asan.yml rename to .github/workflows/asan.yml diff --git a/github/workflows/check.yml b/.github/workflows/check.yml similarity index 100% rename from github/workflows/check.yml rename to .github/workflows/check.yml diff --git a/github/workflows/loom.yml b/.github/workflows/loom.yml similarity index 100% rename from github/workflows/loom.yml rename to .github/workflows/loom.yml diff --git a/github/workflows/lsan.yml b/.github/workflows/lsan.yml similarity index 100% rename from github/workflows/lsan.yml rename to .github/workflows/lsan.yml diff --git a/github/workflows/miri.yml b/.github/workflows/miri.yml similarity index 100% rename from github/workflows/miri.yml rename to .github/workflows/miri.yml diff --git a/github/workflows/nostd.yml b/.github/workflows/nostd.yml similarity index 100% rename from github/workflows/nostd.yml rename to .github/workflows/nostd.yml diff --git a/github/workflows/scheduled.yml b/.github/workflows/scheduled.yml similarity index 100% rename from github/workflows/scheduled.yml rename to .github/workflows/scheduled.yml diff --git a/github/workflows/test.yml b/.github/workflows/test.yml similarity index 100% rename from github/workflows/test.yml rename to .github/workflows/test.yml From 56d4398a24f8c7aae0ba4a74eefaf75d1c3db3a8 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 11:52:12 -0700 Subject: [PATCH 39/73] Merge safety workflows --- .github/workflows/asan.yml | 24 ---------- .github/workflows/loom.yml | 22 --------- .github/workflows/lsan.yml | 32 -------------- .github/workflows/miri.yml | 25 ----------- .github/workflows/safety.yml | 86 ++++++++++++++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 103 deletions(-) delete mode 100644 .github/workflows/asan.yml delete mode 100644 .github/workflows/loom.yml delete mode 100644 .github/workflows/lsan.yml delete mode 100644 .github/workflows/miri.yml create mode 100644 .github/workflows/safety.yml diff --git a/.github/workflows/asan.yml b/.github/workflows/asan.yml deleted file mode 100644 index 5604b7e..0000000 --- a/.github/workflows/asan.yml +++ /dev/null @@ -1,24 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Address sanitizer -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/checkout@v3 - - name: cargo test -Zsanitizer=address - uses: actions-rs/cargo@v1 - with: - command: test - # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 - args: --lib --tests --all-features --target x86_64-unknown-linux-gnu - env: - ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" - RUSTFLAGS: "-Z sanitizer=address" diff --git a/.github/workflows/loom.yml b/.github/workflows/loom.yml deleted file mode 100644 index 8cfe45d..0000000 --- a/.github/workflows/loom.yml +++ /dev/null @@ -1,22 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Loom -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - - uses: actions/checkout@v3 - - name: cargo test --test loom - uses: actions-rs/cargo@v1 - with: - command: test - args: --release --test loom - env: - LOOM_MAX_PREEMPTIONS: 2 - RUSTFLAGS: "--cfg loom" diff --git a/.github/workflows/lsan.yml b/.github/workflows/lsan.yml deleted file mode 100644 index a966913..0000000 --- a/.github/workflows/lsan.yml +++ /dev/null @@ -1,32 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Leak sanitizer -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - uses: actions/checkout@v3 - - run: | - # to get the symbolizer for debug symbol resolution - sudo apt install llvm - # to fix buggy leak analyzer: - # https://github.com/japaric/rust-san#unrealiable-leaksanitizer - sed -i '/\[features\]/i [profile.dev]' Cargo.toml - sed -i '/profile.dev/a opt-level = 1' Cargo.toml - cat Cargo.toml - name: Enable debug symbols - - name: cargo test -Zsanitizer=leak - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --target x86_64-unknown-linux-gnu - env: - RUSTFLAGS: "-Z sanitizer=leak" - LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml deleted file mode 100644 index ae9539a..0000000 --- a/.github/workflows/miri.yml +++ /dev/null @@ -1,25 +0,0 @@ -on: - push: - branches: [main] - pull_request: -name: Miri -jobs: - test: - runs-on: ubuntu-latest - steps: - - run: | - echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ env.NIGHTLY }} - override: true - components: miri - - uses: actions/checkout@v3 - - name: cargo miri test - uses: actions-rs/cargo@v1 - with: - command: miri - args: test - env: - MIRIFLAGS: "-Zmiri-tag-raw-pointers" diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml new file mode 100644 index 0000000..86fc9ee --- /dev/null +++ b/.github/workflows/safety.yml @@ -0,0 +1,86 @@ +on: + push: + branches: [main] + pull_request: +name: safety +jobs: + sanitizers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + default: true + - run: | + # to get the symbolizer for debug symbol resolution + sudo apt install llvm + # to fix buggy leak analyzer: + # https://github.com/japaric/rust-san#unrealiable-leaksanitizer + sed -i '/\[features\]/i [profile.dev]' Cargo.toml + sed -i '/profile.dev/a opt-level = 1' Cargo.toml + cat Cargo.toml + name: Enable debug symbols + - name: cargo test -Zsanitizer=address + uses: actions-rs/cargo@v1 + with: + command: test + # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 + args: --lib --tests --all-features --target x86_64-unknown-linux-gnu + env: + ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" + RUSTFLAGS: "-Z sanitizer=address" + - name: cargo test -Zsanitizer=leak + if: always() + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --target x86_64-unknown-linux-gnu + env: + LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" + RUSTFLAGS: "-Z sanitizer=leak" + miri: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - run: | + echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV + - name: Install ${{ env.NIGHTLY }} + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.NIGHTLY }} + default: true + components: miri + - name: cargo miri test + uses: actions-rs/cargo@v1 + with: + command: miri + args: test + env: + MIRIFLAGS: "-Zmiri-tag-raw-pointers" + loom: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + - name: cargo test --test loom + uses: actions-rs/cargo@v1 + with: + command: test + args: --release --test loom + env: + LOOM_MAX_PREEMPTIONS: 2 + RUSTFLAGS: "--cfg loom" From 15c1fa2ffcc0f31fabcdcd90cde6a05b54baf8b5 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 12:10:58 -0700 Subject: [PATCH 40/73] Catch upcoming deprecations --- .github/workflows/scheduled.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index bb39a22..20229ba 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -33,7 +33,7 @@ jobs: # https://twitter.com/alcuadrado/status/1571291687837732873 update: runs-on: ubuntu-latest - name: ubuntu / stable / updated + name: ubuntu / beta / updated # There's no point running this if no Cargo.lock was checked in in the # first place, since we'd just redo what happened in the regular test job. # Unfortunately, hashFiles only works in if on steps, so we reepeat it. @@ -42,12 +42,13 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - name: Install stable + - name: Install beta if: hashFiles('Cargo.lock') != '' uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: stable + toolchain: beta + default: true - name: cargo update if: hashFiles('Cargo.lock') != '' uses: actions-rs/cargo@v1 @@ -59,3 +60,5 @@ jobs: with: command: test args: --locked --all-features --all-targets + env: + RUSTFLAGS: -D deprecated From ea198cc4991e2f869cd99cb8175652576ef15119 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 13:52:47 -0700 Subject: [PATCH 41/73] More concise name for scheduled jobs --- .github/workflows/scheduled.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 20229ba..a5f5311 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -4,7 +4,7 @@ on: pull_request: schedule: - cron: '7 7 * * *' -name: cargo test (rolling) +name: rolling jobs: # https://twitter.com/mycoliza/status/1571295690063753218 nightly: From 441dc27e4d1e365bfc9b0c25e736da6cb1d15102 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 18 Sep 2022 14:01:04 -0700 Subject: [PATCH 42/73] Allow examples and binaries to require features --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 81c3a01..560e9e2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -82,7 +82,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: hack - args: --feature-powerset check --all-targets + args: --feature-powerset check --lib --tests msrv: runs-on: ubuntu-latest # we use a matrix here just because env can't be used in job names From b783cb31ab3c6c27ad826bde44aa917c0d0908da Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 23 Sep 2022 08:53:07 -0700 Subject: [PATCH 43/73] Use dependabot, but only for major versions --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..22cfb43 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: daily + ignore: + dependency-name: "*" + # patch and minor updates don't matter for libraries + # remove this ignore rule if your package has binaries + update-types: + - "version-update:semver-patch" + - "version-update:semver-minor" From cf47d4cad4b241a30245a51aa1ac7e99e7fedf8a Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Wed, 28 Sep 2022 18:23:39 -0700 Subject: [PATCH 44/73] ignore is a list --- .github/dependabot.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 22cfb43..9c60153 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,9 +5,9 @@ updates: schedule: interval: daily ignore: - dependency-name: "*" - # patch and minor updates don't matter for libraries - # remove this ignore rule if your package has binaries - update-types: - - "version-update:semver-patch" - - "version-update:semver-minor" + - dependency-name: "*" + # patch and minor updates don't matter for libraries + # remove this ignore rule if your package has binaries + update-types: + - "version-update:semver-patch" + - "version-update:semver-minor" From 82cbed84f82e8538cdfc99dcf1b8b2cbab4fb126 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 9 Dec 2022 16:25:21 -0800 Subject: [PATCH 45/73] Notify if actions themselves are outdated --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9c60153..8139a93 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,9 @@ version: 2 updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily - package-ecosystem: cargo directory: / schedule: From c8a7835b2f0b21d9a64e6a8b0ddc10fbc88e2dd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 10 Dec 2022 00:25:41 +0000 Subject: [PATCH 46/73] Bump codecov/codecov-action from 2 to 3 Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v2...v3) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83645f8..9569167 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -108,6 +108,6 @@ jobs: - name: cargo llvm-cov run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info - name: Upload to codecov.io - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true From 362696ab8007ef1a4779885a398286856cacf555 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 10 Mar 2023 21:16:35 -0800 Subject: [PATCH 47/73] Move to maintained rust installer See https://github.com/actions-rs/toolchain/issues/216 --- .github/workflows/check.yml | 23 +++++------------------ .github/workflows/nostd.yml | 11 ++++++----- .github/workflows/safety.yml | 15 +++------------ .github/workflows/scheduled.yml | 12 ++---------- .github/workflows/test.yml | 25 +++++++------------------ 5 files changed, 23 insertions(+), 63 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 560e9e2..da175c2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,10 +12,8 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: rustfmt - name: cargo fmt --check uses: actions-rs/cargo@v1 @@ -34,11 +32,9 @@ jobs: with: submodules: true - name: Install ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.toolchain }} - default: true components: clippy - name: cargo clippy uses: actions-rs/clippy-check@v1 @@ -52,11 +48,7 @@ jobs: with: submodules: true - name: Install nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - default: true + uses: dtolnay/rust-toolchain@nightly - name: cargo doc uses: actions-rs/cargo@v1 with: @@ -72,10 +64,7 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack - name: cargo hack @@ -96,11 +85,9 @@ jobs: with: submodules: true - name: Install ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.msrv }} - default: true - name: cargo +${{ matrix.msrv }} check uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 409ae73..235df26 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -11,12 +11,13 @@ jobs: matrix: target: [thumbv7m-none-eabi, aarch64-unknown-none] steps: - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: ${{ matrix.target }} - uses: actions/checkout@v3 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + - name: rustup target add ${{ matrix.target }} + run: rustup target add ${{ matrix.target }} - name: cargo check uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 86fc9ee..77f56a4 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -11,11 +11,7 @@ jobs: with: submodules: true - name: Install nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - default: true + uses: dtolnay/rust-toolchain@nightly - run: | # to get the symbolizer for debug symbol resolution sudo apt install llvm @@ -52,11 +48,9 @@ jobs: - run: | echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV - name: Install ${{ env.NIGHTLY }} - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ env.NIGHTLY }} - default: true components: miri - name: cargo miri test uses: actions-rs/cargo@v1 @@ -72,10 +66,7 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + uses: dtolnay/rust-toolchain@stable - name: cargo test --test loom uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index a5f5311..e341e9b 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -15,11 +15,7 @@ jobs: with: submodules: true - name: Install nightly - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - default: true + uses: dtolnay/rust-toolchain@nightly - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' uses: actions-rs/cargo@v1 @@ -44,11 +40,7 @@ jobs: submodules: true - name: Install beta if: hashFiles('Cargo.lock') != '' - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: beta - default: true + uses: dtolnay/rust-toolchain@beta - name: cargo update if: hashFiles('Cargo.lock') != '' uses: actions-rs/cargo@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9569167..53db840 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,9 @@ jobs: with: submodules: true - name: Install ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{ matrix.toolchain }} - default: true - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' uses: actions-rs/cargo@v1 @@ -39,15 +37,11 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: Install nightly for -Zminimal-versions - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly + uses: dtolnay/rust-toolchain@nightly + - name: rustup default stable + run: rustup default stable - name: cargo update -Zminimal-versions uses: actions-rs/cargo@v1 with: @@ -71,10 +65,7 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable + uses: dtolnay/rust-toolchain@stable - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' uses: actions-rs/cargo@v1 @@ -93,10 +84,8 @@ jobs: with: submodules: true - name: Install stable - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable components: llvm-tools-preview - name: cargo install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov From 90999e1bd1a9dabaecd149697f69e8e26e810562 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 10 Mar 2023 21:22:30 -0800 Subject: [PATCH 48/73] Fix install message for msrv --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index da175c2..d25da88 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -84,7 +84,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - name: Install ${{ matrix.toolchain }} + - name: Install ${{ matrix.msrv }} uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.msrv }} From 9afb0e111adcd678ef06884cf737aa9e0cf135e7 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 11 Mar 2023 15:07:39 -0800 Subject: [PATCH 49/73] Get rid of most actions-rs bits Given that that project is unmaintained. https://github.com/actions-rs/toolchain/issues/216 --- .github/workflows/check.yml | 19 ++++--------------- .github/workflows/nostd.yml | 5 +---- .github/workflows/safety.yml | 22 +++++----------------- .github/workflows/scheduled.yml | 18 ++++-------------- .github/workflows/test.yml | 33 +++++++-------------------------- 5 files changed, 21 insertions(+), 76 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d25da88..29fc888 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -16,10 +16,7 @@ jobs: with: components: rustfmt - name: cargo fmt --check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check + run: cargo fmt --check clippy: runs-on: ubuntu-latest name: ${{ matrix.toolchain }} / clippy @@ -50,10 +47,7 @@ jobs: - name: Install nightly uses: dtolnay/rust-toolchain@nightly - name: cargo doc - uses: actions-rs/cargo@v1 - with: - command: doc - args: --no-deps --all-features + run: cargo doc --no-deps --all-features env: RUSTDOCFLAGS: --cfg docsrs hack: @@ -68,10 +62,7 @@ jobs: - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack - name: cargo hack - uses: actions-rs/cargo@v1 - with: - command: hack - args: --feature-powerset check --lib --tests + run: cargo hack --feature-powerset check --lib --tests msrv: runs-on: ubuntu-latest # we use a matrix here just because env can't be used in job names @@ -89,6 +80,4 @@ jobs: with: toolchain: ${{ matrix.msrv }} - name: cargo +${{ matrix.msrv }} check - uses: actions-rs/cargo@v1 - with: - command: check + run: cargo check diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 235df26..397a2da 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -19,7 +19,4 @@ jobs: - name: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }} - name: cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: --target ${{ matrix.target }} --no-default-features + run: cargo check --target ${{ matrix.target }} --no-default-features diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 77f56a4..6c973c0 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -22,20 +22,14 @@ jobs: cat Cargo.toml name: Enable debug symbols - name: cargo test -Zsanitizer=address - uses: actions-rs/cargo@v1 - with: - command: test - # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 - args: --lib --tests --all-features --target x86_64-unknown-linux-gnu + # only --lib --tests b/c of https://github.com/rust-lang/rust/issues/53945 + run: cargo test --lib --tests --all-features --target x86_64-unknown-linux-gnu env: ASAN_OPTIONS: "detect_odr_violation=0:detect_leaks=0" RUSTFLAGS: "-Z sanitizer=address" - name: cargo test -Zsanitizer=leak if: always() - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --target x86_64-unknown-linux-gnu + run: cargo test --all-features --target x86_64-unknown-linux-gnu env: LSAN_OPTIONS: "suppressions=lsan-suppressions.txt" RUSTFLAGS: "-Z sanitizer=leak" @@ -53,10 +47,7 @@ jobs: toolchain: ${{ env.NIGHTLY }} components: miri - name: cargo miri test - uses: actions-rs/cargo@v1 - with: - command: miri - args: test + run: cargo miri test env: MIRIFLAGS: "-Zmiri-tag-raw-pointers" loom: @@ -68,10 +59,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable - name: cargo test --test loom - uses: actions-rs/cargo@v1 - with: - command: test - args: --release --test loom + run: cargo test --release --test loom env: LOOM_MAX_PREEMPTIONS: 2 RUSTFLAGS: "--cfg loom" diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index e341e9b..2c15695 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -18,14 +18,9 @@ jobs: uses: dtolnay/rust-toolchain@nightly - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo test --locked - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-features --all-targets + run: cargo test --locked --all-features --all-targets # https://twitter.com/alcuadrado/status/1571291687837732873 update: runs-on: ubuntu-latest @@ -43,14 +38,9 @@ jobs: uses: dtolnay/rust-toolchain@beta - name: cargo update if: hashFiles('Cargo.lock') != '' - uses: actions-rs/cargo@v1 - with: - command: update + run: cargo update - name: cargo test if: hashFiles('Cargo.lock') != '' - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-features --all-targets + run: cargo test --locked --all-features --all-targets env: RUSTFLAGS: -D deprecated diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53db840..4435fd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,15 +20,10 @@ jobs: toolchain: ${{ matrix.toolchain }} - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-features --all-targets + run: cargo test --locked --all-features --all-targets minimal: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions @@ -43,16 +38,9 @@ jobs: - name: rustup default stable run: rustup default stable - name: cargo update -Zminimal-versions - uses: actions-rs/cargo@v1 - with: - command: update - toolchain: nightly - args: -Zminimal-versions + run: cargo +nightly update -Zminimal-versions - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-features --all-targets + run: cargo test --locked --all-features --all-targets os-check: runs-on: ${{ matrix.os }} name: ${{ matrix.os }} / stable @@ -68,14 +56,9 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: --locked --all-features --all-targets + run: cargo test --locked --all-features --all-targets coverage: runs-on: ubuntu-latest name: ubuntu / stable / coverage @@ -91,9 +74,7 @@ jobs: uses: taiki-e/install-action@cargo-llvm-cov - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' - uses: actions-rs/cargo@v1 - with: - command: generate-lockfile + run: cargo generate-lockfile - name: cargo llvm-cov run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info - name: Upload to codecov.io From a076ec1cb42e88e6444ae7f573570ec53c149074 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 11 Mar 2023 15:08:45 -0800 Subject: [PATCH 50/73] Minimal token permissions See https://github.com/tokio-rs/tokio/pull/5072 --- .github/workflows/check.yml | 5 +++++ .github/workflows/nostd.yml | 2 ++ .github/workflows/safety.yml | 2 ++ .github/workflows/scheduled.yml | 2 ++ .github/workflows/test.yml | 2 ++ 5 files changed, 13 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 29fc888..406ba9b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,3 +1,5 @@ +permissions: + contents: read on: push: branches: [main] @@ -20,6 +22,9 @@ jobs: clippy: runs-on: ubuntu-latest name: ${{ matrix.toolchain }} / clippy + permissions: + contents: read + checks: write strategy: fail-fast: false matrix: diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 397a2da..7efae0f 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -1,3 +1,5 @@ +permissions: + contents: read on: push: branches: [main] diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 6c973c0..4fa7ad7 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -1,3 +1,5 @@ +permissions: + contents: read on: push: branches: [main] diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 2c15695..0215432 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,3 +1,5 @@ +permissions: + contents: read on: push: branches: [main] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4435fd7..8aa4488 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,3 +1,5 @@ +permissions: + contents: read on: push: branches: [main] From 5ea59356dc9379a08dff5bf3df3c5016df2ca7f3 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 12 Mar 2023 09:40:09 -0700 Subject: [PATCH 51/73] Remove -Zmiri-tag-raw-pointers as it's now default --- .github/workflows/safety.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 4fa7ad7..edf40e5 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -51,7 +51,7 @@ jobs: - name: cargo miri test run: cargo miri test env: - MIRIFLAGS: "-Zmiri-tag-raw-pointers" + MIRIFLAGS: "" loom: runs-on: ubuntu-latest steps: From 0d12c82bf4a89014643cd2b7991c63da9dd8b15b Mon Sep 17 00:00:00 2001 From: Tudyx <56633664+Tudyx@users.noreply.github.com> Date: Mon, 20 Mar 2023 01:17:59 +0100 Subject: [PATCH 52/73] Unbreak cargo hack for non-libraries (#4) --- .github/workflows/check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 406ba9b..a687dfa 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -66,8 +66,9 @@ jobs: uses: dtolnay/rust-toolchain@stable - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack + # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 - name: cargo hack - run: cargo hack --feature-powerset check --lib --tests + run: cargo hack --feature-powerset check msrv: runs-on: ubuntu-latest # we use a matrix here just because env can't be used in job names From 80a89195f2ac9971ecff9d422a6bb83b3f84e0bc Mon Sep 17 00:00:00 2001 From: Burkhard Mittelbach Date: Mon, 20 Mar 2023 01:18:49 +0100 Subject: [PATCH 53/73] Add action to run doctest. (#3) `cargo test --all-features` does not run doc-tests. For more information see https://github.com/rust-lang/cargo/issues/6669. --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8aa4488..c675b38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,6 +26,9 @@ jobs: # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked run: cargo test --locked --all-features --all-targets + # https://github.com/rust-lang/cargo/issues/6669 + - name: cargo test --doc + run: cargo test --locked --all-features --doc minimal: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions From 16a2c2925eb46e24208b20bca567f1e7546f4e2f Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sat, 8 Apr 2023 18:57:54 +0200 Subject: [PATCH 54/73] chore: automatically cancel superseded Actions runs (#5) --- .github/workflows/check.yml | 4 ++++ .github/workflows/nostd.yml | 4 ++++ .github/workflows/safety.yml | 4 ++++ .github/workflows/scheduled.yml | 4 ++++ .github/workflows/test.yml | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a687dfa..3fb97ad 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -4,6 +4,10 @@ on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: check jobs: fmt: diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 7efae0f..32d56c3 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -4,6 +4,10 @@ on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: no-std jobs: nostd: diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index edf40e5..9c7aeee 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -4,6 +4,10 @@ on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: safety jobs: sanitizers: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 0215432..d4e19dd 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -6,6 +6,10 @@ on: pull_request: schedule: - cron: '7 7 * * *' +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: rolling jobs: # https://twitter.com/mycoliza/status/1571295690063753218 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c675b38..4d0417c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,10 @@ on: push: branches: [main] pull_request: +# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true name: test jobs: required: From 6332a3af21a58f811a681a98cd44d0f5da8a1891 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Mon, 24 Apr 2023 12:40:14 -0700 Subject: [PATCH 55/73] [sanity] More robust injection of opt-level 1 (#9) Fixes #8 --- .github/workflows/safety.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 9c7aeee..eb5a5d6 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -23,8 +23,15 @@ jobs: sudo apt install llvm # to fix buggy leak analyzer: # https://github.com/japaric/rust-san#unrealiable-leaksanitizer - sed -i '/\[features\]/i [profile.dev]' Cargo.toml - sed -i '/profile.dev/a opt-level = 1' Cargo.toml + # ensure there's a profile.dev section + if ! grep -qE '^[ \t]*[profile.dev]' Cargo.toml; then + echo >> Cargo.toml + echo '[profile.dev]' >> Cargo.toml + fi + # remove pre-existing opt-levels in profile.dev + sed -i '/^\s*\[profile.dev\]/,/^\s*\[/ {/^\s*opt-level/d}' Cargo.toml + # now set opt-level to 1 + sed -i '/^\s*\[profile.dev\]/a opt-level = 1' Cargo.toml cat Cargo.toml name: Enable debug symbols - name: cargo test -Zsanitizer=address From 99f108f93c4f09906a4ddd4506fa4a2cbc68169d Mon Sep 17 00:00:00 2001 From: James Chacon Date: Sun, 13 Aug 2023 03:13:38 -0700 Subject: [PATCH 56/73] Quote MSRV version to avoid float parsing (#11) Put 1.70 in there (for instance if you want to pin against OnceLock stabilizing) and it will actually test 1.7 as it appears github auto converts this to a float? Putting in quotes seems to do the right thing here --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3fb97ad..6b136dc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -79,7 +79,7 @@ jobs: # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: - msrv: [1.56.1] # 2021 edition requires 1.56 + msrv: ["1.56.1"] # 2021 edition requires 1.56 name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v3 From c704bcc656871d37f93f79234c4d530522ac8733 Mon Sep 17 00:00:00 2001 From: Rod Elias Date: Sun, 20 Aug 2023 09:40:15 -0300 Subject: [PATCH 57/73] Install Openssl for Windows (#12) --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d0417c..9389fd3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,6 +58,10 @@ jobs: matrix: os: [macos-latest, windows-latest] steps: + - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append + if: runner.os == 'Windows' + - run: vcpkg install openssl:x64-windows-static-md + if: runner.os == 'Windows' - uses: actions/checkout@v3 with: submodules: true From 7c327ddf5b42f5309f564da8275c789c4a22fdbb Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 20 Aug 2023 15:12:25 +0200 Subject: [PATCH 58/73] Don't install OpenSSL on Windows by default --- .github/workflows/test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9389fd3..3ef2713 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,10 +58,12 @@ jobs: matrix: os: [macos-latest, windows-latest] steps: - - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append - if: runner.os == 'Windows' - - run: vcpkg install openssl:x64-windows-static-md - if: runner.os == 'Windows' + # if your project needs OpenSSL, uncommment this to fix Windows builds. + # it's commented out by default as tthe install command takes 5-10m. + # - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append + # if: runner.os == 'Windows' + # - run: vcpkg install openssl:x64-windows-static-md + # if: runner.os == 'Windows' - uses: actions/checkout@v3 with: submodules: true From deb9fd3f46de5eebd2583292362a161b1d1c56c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 16:21:14 +0200 Subject: [PATCH 59/73] Bump actions/checkout from 3 to 4 (#13) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check.yml | 10 +++++----- .github/workflows/nostd.yml | 2 +- .github/workflows/safety.yml | 6 +++--- .github/workflows/scheduled.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6b136dc..3fdc139 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest name: stable / fmt steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -34,7 +34,7 @@ jobs: matrix: toolchain: [stable, beta] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.toolchain }} @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest name: nightly / doc steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install nightly @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest name: ubuntu / stable / features steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -82,7 +82,7 @@ jobs: msrv: ["1.56.1"] # 2021 edition requires 1.56 name: ubuntu / ${{ matrix.msrv }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.msrv }} diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 32d56c3..00362a6 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -17,7 +17,7 @@ jobs: matrix: target: [thumbv7m-none-eabi, aarch64-unknown-none] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index eb5a5d6..ce1e38e 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -13,7 +13,7 @@ jobs: sanitizers: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install nightly @@ -49,7 +49,7 @@ jobs: miri: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - run: | @@ -66,7 +66,7 @@ jobs: loom: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index d4e19dd..4607f3e 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest name: ubuntu / nightly steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install nightly @@ -36,7 +36,7 @@ jobs: # Unfortunately, hashFiles only works in if on steps, so we reepeat it. # if: hashFiles('Cargo.lock') != '' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install beta diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ef2713..56bd560 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: matrix: toolchain: [stable, beta] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install ${{ matrix.toolchain }} @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -64,7 +64,7 @@ jobs: # if: runner.os == 'Windows' # - run: vcpkg install openssl:x64-windows-static-md # if: runner.os == 'Windows' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest name: ubuntu / stable / coverage steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Install stable From bfee1175f6378c9191eca0af88e068ed49d48bef Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Sat, 11 Nov 2023 01:14:12 -0800 Subject: [PATCH 60/73] docs: Add documentation based on the youtube video (#10) --- .github/DOCS.md | 23 ++++++++++++++++++++ .github/codecov.yml | 2 +- .github/dependabot.yml | 6 ++++-- .github/workflows/check.yml | 21 ++++++++++++++++++- .github/workflows/nostd.yml | 4 +++- .github/workflows/safety.yml | 8 ++++++- .github/workflows/scheduled.yml | 16 +++++++++----- .github/workflows/test.yml | 37 ++++++++++++++++++++++++++++++++- 8 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 .github/DOCS.md diff --git a/.github/DOCS.md b/.github/DOCS.md new file mode 100644 index 0000000..e932784 --- /dev/null +++ b/.github/DOCS.md @@ -0,0 +1,23 @@ +# Github config and workflows + +In this folder there is configuration for codecoverage, dependabot, and ci +workflows that check the library more deeply than the default configurations. + +This folder can be or was merged using a --allow-unrelated-histories merge +strategy from which provides a +reasonably sensible base for writing your own ci on. By using this strategy +the history of the CI repo is included in your repo, and future updates to +the CI can be merged later. + +To perform this merge run: + +```shell +git remote add ci https://github.com/jonhoo/rust-ci-conf.git +git fetch ci +git merge --allow-unrelated-histories ci/main +``` + +An overview of the files in this project is available at: +, which contains some +rationale for decisions and runs through an example of solving minimal version +and OpenSSL issues. diff --git a/.github/codecov.yml b/.github/codecov.yml index ff4f571..cd5ce8f 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -18,4 +18,4 @@ ignore: # Make comments less noisy comment: layout: "files" - require_changes: yes + require_changes: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8139a93..d0f091e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,8 +10,10 @@ updates: interval: daily ignore: - dependency-name: "*" - # patch and minor updates don't matter for libraries - # remove this ignore rule if your package has binaries + # patch and minor updates don't matter for libraries as consumers of this library build + # with their own lockfile, rather than the version specified in this library's lockfile + # remove this ignore rule if your package has binaries to ensure that the binaries are + # built with the exact set of dependencies and those are up to date. update-types: - "version-update:semver-patch" - "version-update:semver-minor" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3fdc139..6b4d13a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,10 +1,21 @@ +# This workflow runs whenever a PR is opened or updated, or a commit is pushed to main. It runs +# several checks: +# - fmt: checks that the code is formatted according to rustfmt +# - clippy: checks that the code does not contain any clippy warnings +# - doc: checks that the code can be documented without errors +# - hack: check combinations of feature flags +# - msrv: check that the msrv specified in the crate is correct permissions: contents: read +# This configuration allows maintainers of this repo to create a branch and pull request based on +# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets +# built once. on: push: branches: [main] pull_request: -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 +# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that +# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -32,6 +43,7 @@ jobs: strategy: fail-fast: false matrix: + # Get early warning of new lints which are regularly introduced in beta channels. toolchain: [stable, beta] steps: - uses: actions/checkout@v4 @@ -47,6 +59,9 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} doc: + # run docs generation on nightly rather than stable. This enables features like + # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an + # API be documented as only available in some specific platforms. runs-on: ubuntu-latest name: nightly / doc steps: @@ -60,6 +75,8 @@ jobs: env: RUSTDOCFLAGS: --cfg docsrs hack: + # cargo-hack checks combinations of feature flags to ensure that features are all additive + # which is required for feature unification runs-on: ubuntu-latest name: ubuntu / stable / features steps: @@ -71,9 +88,11 @@ jobs: - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 + # --feature-powerset runs for every combination of features - name: cargo hack run: cargo hack --feature-powerset check msrv: + # check that we can build using the minimal rust version that is specified by this crate runs-on: ubuntu-latest # we use a matrix here just because env can't be used in job names # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 00362a6..93a1698 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -1,10 +1,12 @@ +# This workflow checks whether the library is able to run without the std library (e.g., embedded). +# This entire file should be removed if this crate does not support no-std. See check.yml for +# information about how the concurrency cancelation and workflow triggering works permissions: contents: read on: push: branches: [main] pull_request: -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index ce1e38e..afea8df 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -1,10 +1,16 @@ +# This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be +# removed. Runs: +# - miri - detects undefined behavior and memory leaks +# - address santizer - detects memory errors +# - leak sanitizer - detects memory leaks +# - loom - Permutation testing for concurrent code https://crates.io/crates/loom +# See check.yml for information about how the concurrency cancelation and workflow triggering works permissions: contents: read on: push: branches: [main] pull_request: -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 4607f3e..15b1a7c 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,3 +1,6 @@ +# Run scheduled (rolling) jobs on a nightly basis, as your crate may break independently of any +# given PR. E.g., updates to rust nightly and updates to this crates dependencies. See check.yml for +# information about how the concurrency cancelation and workflow triggering works permissions: contents: read on: @@ -6,7 +9,6 @@ on: pull_request: schedule: - cron: '7 7 * * *' -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -29,12 +31,16 @@ jobs: run: cargo test --locked --all-features --all-targets # https://twitter.com/alcuadrado/status/1571291687837732873 update: + # This action checks that updating the dependencies of this crate to the latest available that + # satisfy the versions in Cargo.toml does not break this crate. This is important as consumers + # of this crate will generally use the latest available crates. This is subject to the standard + # Cargo semver rules (i.e cargo does not update to a new major version unless explicitly told + # to). runs-on: ubuntu-latest name: ubuntu / beta / updated - # There's no point running this if no Cargo.lock was checked in in the - # first place, since we'd just redo what happened in the regular test job. - # Unfortunately, hashFiles only works in if on steps, so we reepeat it. - # if: hashFiles('Cargo.lock') != '' + # There's no point running this if no Cargo.lock was checked in in the first place, since we'd + # just redo what happened in the regular test job. Unfortunately, hashFiles only works in if on + # steps, so we repeat it. steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56bd560..ab86e2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,17 @@ +# This is the main CI workflow that runs the test suite on all pushes to main and all pull requests. +# It runs the following jobs: +# - required: runs the test suite on ubuntu with stable and beta rust toolchains +# - minimal: runs the test suite with the minimal versions of the dependencies that satisfy the +# requirements of this crate, and its dependencies +# - os-check: runs the test suite on mac and windows +# - coverage: runs the test suite and collects coverage information +# See check.yml for information about how the concurrency cancelation and workflow triggering works permissions: contents: read on: push: branches: [main] pull_request: -# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -15,6 +22,8 @@ jobs: name: ubuntu / ${{ matrix.toolchain }} strategy: matrix: + # run on stable and beta to ensure that tests won't break on the next version of the rust + # toolchain toolchain: [stable, beta] steps: - uses: actions/checkout@v4 @@ -25,6 +34,7 @@ jobs: with: toolchain: ${{ matrix.toolchain }} - name: cargo generate-lockfile + # enable this ci template to run regardless of whether the lockfile is checked in or not if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile # https://twitter.com/jonhoo/status/1571290371124260865 @@ -34,6 +44,28 @@ jobs: - name: cargo test --doc run: cargo test --locked --all-features --doc minimal: + # This action chooses the oldest version of the dependencies permitted by Cargo.toml to ensure + # that this crate is compatible with the minimal version that this crate and its dependencies + # require. This will pickup issues where this create relies on functionality that was introduced + # later than the actual version specified (e.g., when we choose just a major version, but a + # method was added after this version). + # + # This particular check can be difficult to get to succeed as often transitive dependencies may + # be incorrectly specified (e.g., a dependency specifies 1.0 but really requires 1.1.5). There + # is an alternative flag available -Zminimal-direct that uses the minimal versions for direct + # dependencies of this crate, while selecting the maximal versions for the transitive + # dependencies. Alternatively, you can add a line in your Cargo.toml to artificially increase + # the minimal dependency, which you do with e.g.: + # ```toml + # # for minimal-versions + # [target.'cfg(any())'.dependencies] + # openssl = { version = "0.10.55", optional = true } # needed to allow foo to build with -Zminimal-versions + # ``` + # The optional = true is necessary in case that dependency isn't otherwise transitively required + # by your library, and the target bit is so that this dependency edge never actually affects + # Cargo build order. See also + # https://github.com/jonhoo/fantoccini/blob/fde336472b712bc7ebf5b4e772023a7ba71b2262/Cargo.toml#L47-L49. + # This action is run on ubuntu with the stable toolchain, as it is not expected to fail runs-on: ubuntu-latest name: ubuntu / stable / minimal-versions steps: @@ -51,6 +83,7 @@ jobs: - name: cargo test run: cargo test --locked --all-features --all-targets os-check: + # run cargo test on mac and windows runs-on: ${{ matrix.os }} name: ${{ matrix.os }} / stable strategy: @@ -75,6 +108,8 @@ jobs: - name: cargo test run: cargo test --locked --all-features --all-targets coverage: + # use llvm-cov to build and collect coverage and outputs in a format that is compatible with + # codecov.io runs-on: ubuntu-latest name: ubuntu / stable / coverage steps: From 3d6ab95662ede7ae2898cdc7bd5b75668c7b8ca0 Mon Sep 17 00:00:00 2001 From: Mathias Pius Date: Sat, 11 Nov 2023 15:01:33 +0100 Subject: [PATCH 61/73] Nit: Selecting direct minimal versions flag is -Zdirect-minimal-versions (#16) --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab86e2d..59028e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,14 +52,14 @@ jobs: # # This particular check can be difficult to get to succeed as often transitive dependencies may # be incorrectly specified (e.g., a dependency specifies 1.0 but really requires 1.1.5). There - # is an alternative flag available -Zminimal-direct that uses the minimal versions for direct - # dependencies of this crate, while selecting the maximal versions for the transitive + # is an alternative flag available -Zdirect-minimal-versions that uses the minimal versions for + # direct dependencies of this crate, while selecting the maximal versions for the transitive # dependencies. Alternatively, you can add a line in your Cargo.toml to artificially increase # the minimal dependency, which you do with e.g.: # ```toml # # for minimal-versions # [target.'cfg(any())'.dependencies] - # openssl = { version = "0.10.55", optional = true } # needed to allow foo to build with -Zminimal-versions + # openssl = { version = "0.10.55", optional = true } # needed to allow foo to build with -Zminimal-versions # ``` # The optional = true is necessary in case that dependency isn't otherwise transitively required # by your library, and the target bit is so that this dependency edge never actually affects From 60fdfbb65055e7e852820a75d9cf80b88d020702 Mon Sep 17 00:00:00 2001 From: Anas Date: Sun, 17 Dec 2023 17:52:41 +0200 Subject: [PATCH 62/73] chore: fix typos (#17) --- .github/workflows/nostd.yml | 2 +- .github/workflows/safety.yml | 4 ++-- .github/workflows/scheduled.yml | 2 +- .github/workflows/test.yml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 93a1698..c12227a 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -1,6 +1,6 @@ # This workflow checks whether the library is able to run without the std library (e.g., embedded). # This entire file should be removed if this crate does not support no-std. See check.yml for -# information about how the concurrency cancelation and workflow triggering works +# information about how the concurrency cancellation and workflow triggering works permissions: contents: read on: diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index afea8df..6bdd055 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -1,10 +1,10 @@ # This workflow runs checks for unsafe code. In crates that don't have any unsafe code, this can be # removed. Runs: # - miri - detects undefined behavior and memory leaks -# - address santizer - detects memory errors +# - address sanitizer - detects memory errors # - leak sanitizer - detects memory leaks # - loom - Permutation testing for concurrent code https://crates.io/crates/loom -# See check.yml for information about how the concurrency cancelation and workflow triggering works +# See check.yml for information about how the concurrency cancellation and workflow triggering works permissions: contents: read on: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 15b1a7c..02aa275 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -1,6 +1,6 @@ # Run scheduled (rolling) jobs on a nightly basis, as your crate may break independently of any # given PR. E.g., updates to rust nightly and updates to this crates dependencies. See check.yml for -# information about how the concurrency cancelation and workflow triggering works +# information about how the concurrency cancellation and workflow triggering works permissions: contents: read on: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59028e1..b98103d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ # requirements of this crate, and its dependencies # - os-check: runs the test suite on mac and windows # - coverage: runs the test suite and collects coverage information -# See check.yml for information about how the concurrency cancelation and workflow triggering works +# See check.yml for information about how the concurrency cancellation and workflow triggering works permissions: contents: read on: @@ -91,8 +91,8 @@ jobs: matrix: os: [macos-latest, windows-latest] steps: - # if your project needs OpenSSL, uncommment this to fix Windows builds. - # it's commented out by default as tthe install command takes 5-10m. + # if your project needs OpenSSL, uncomment this to fix Windows builds. + # it's commented out by default as the install command takes 5-10m. # - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append # if: runner.os == 'Windows' # - run: vcpkg install openssl:x64-windows-static-md From a13691528b3f1918594bfc53db8cf5ad0240c59e Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 17 Dec 2023 18:15:06 +0100 Subject: [PATCH 63/73] Remove stray trailing whitespace --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b98103d..fce7118 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,8 +57,8 @@ jobs: # dependencies. Alternatively, you can add a line in your Cargo.toml to artificially increase # the minimal dependency, which you do with e.g.: # ```toml - # # for minimal-versions - # [target.'cfg(any())'.dependencies] + # # for minimal-versions + # [target.'cfg(any())'.dependencies] # openssl = { version = "0.10.55", optional = true } # needed to allow foo to build with -Zminimal-versions # ``` # The optional = true is necessary in case that dependency isn't otherwise transitively required From f505e09b2a145de0df7445ca0ebe1f98b52ab3bc Mon Sep 17 00:00:00 2001 From: rtkay123 <70331483+rtkay123@users.noreply.github.com> Date: Sat, 20 Jan 2024 11:10:51 +0200 Subject: [PATCH 64/73] replace actions-rs/clippy-check with giraffate/clippy-action (#19) Co-authored-by: rtkay123 --- .github/workflows/check.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6b4d13a..c869ee7 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -55,9 +55,10 @@ jobs: toolchain: ${{ matrix.toolchain }} components: clippy - name: cargo clippy - uses: actions-rs/clippy-check@v1 + uses: giraffate/clippy-action@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} + reporter: 'github-pr-check' + github_token: ${{ secrets.GITHUB_TOKEN }} doc: # run docs generation on nightly rather than stable. This enables features like # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an From f8f04aefdf3c756e6a769399ce2ac89979338ad0 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 3 Feb 2024 09:31:12 +0100 Subject: [PATCH 65/73] Semi-breaking: update codecov action Note: this requires adding `CODECOV_TOKEN` to your GitHub repository's secrets! See associated comment in the commit content. --- .github/workflows/test.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fce7118..debdfe8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -108,8 +108,27 @@ jobs: - name: cargo test run: cargo test --locked --all-features --all-targets coverage: - # use llvm-cov to build and collect coverage and outputs in a format that is compatible with - # codecov.io + # use llvm-cov to build and collect coverage and outputs in a format that + # is compatible with codecov.io + # + # note that codecov as of v4 requires that CODECOV_TOKEN from + # + # https://app.codecov.io/gh///settings + # + # is set in two places on your repo: + # + # - https://github.com/jonhoo/guardian/settings/secrets/actions + # - https://github.com/jonhoo/guardian/settings/secrets/dependabot + # + # (the former is needed for codecov uploads to work with Dependabot PRs) + # + # PRs coming from forks of your repo will not have access to the token, but + # for those, codecov allows uploading coverage reports without a token. + # it's all a little weird and inconvenient. see + # + # https://github.com/codecov/feedback/issues/112 + # + # for lots of more discussion runs-on: ubuntu-latest name: ubuntu / stable / coverage steps: @@ -127,7 +146,11 @@ jobs: run: cargo generate-lockfile - name: cargo llvm-cov run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info + - name: record Rust version + run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV" - name: Upload to codecov.io - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + env_vars: OS,RUST From caa3616c250361bac585b6979e5390e403b45097 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 3 Feb 2024 09:44:41 +0100 Subject: [PATCH 66/73] Uniform capitalization --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index debdfe8..f7540ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -146,7 +146,7 @@ jobs: run: cargo generate-lockfile - name: cargo llvm-cov run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info - - name: record Rust version + - name: Record Rust version run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV" - name: Upload to codecov.io uses: codecov/codecov-action@v4 From 528977532c28ad859bea7ba0cb5e6cb3e0fce56b Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 31 Mar 2024 10:42:53 +0200 Subject: [PATCH 67/73] Add cargo-semver-checks --- .github/workflows/check.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c869ee7..98834bf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -59,6 +59,19 @@ jobs: with: reporter: 'github-pr-check' github_token: ${{ secrets.GITHUB_TOKEN }} + semver: + runs-on: ubuntu-latest + name: semver + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Install stable + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: cargo-semver-checks + uses: obi1kenobi/cargo-semver-checks-action@v2 doc: # run docs generation on nightly rather than stable. This enables features like # https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an From dcf68836181145511a35a269e8392d0a0f0c61e1 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 7 Jul 2024 10:05:52 +0200 Subject: [PATCH 68/73] More intelligent dependabot behaviour --- .github/dependabot.yml | 59 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d0f091e..f9d7d1c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,16 +4,63 @@ updates: directory: / schedule: interval: daily + # Cargo major version update notifications (PRs) we always want - package-ecosystem: cargo directory: / - schedule: - interval: daily ignore: - dependency-name: "*" - # patch and minor updates don't matter for libraries as consumers of this library build - # with their own lockfile, rather than the version specified in this library's lockfile - # remove this ignore rule if your package has binaries to ensure that the binaries are - # built with the exact set of dependencies and those are up to date. update-types: - "version-update:semver-patch" - "version-update:semver-minor" + schedule: + # we want to know about them immediately + interval: daily + groups: + # we group major bumps for dev-dependencies together in case there are + # related groups of breaking changes. that _can_ be the case for + # production dependencies too, but there one should be more diligent + # about each major bump in case it constitutes a breaking change to the + # current crate too. + major-dev: + dependency-type: "development" + update-types: + - "major" + # patch and minor updates don't matter for libraries, as consumers of a + # library build with their own lockfile, rather than the version specified in + # this library's lockfile. so for libraries (which is most crates), we should + # never update non-major versions, and so the following rule is disabled by + # default. + # + # if your package has binaries, enable this rule by commenting out the + # `open-pull-requests-limit` line. this will open a PR once a month that + # effectively runs `cargo update` to ensure that the binaries are built with + # the exact set of dependencies and those are up to date. + - package-ecosystem: cargo + # this rule is disabled by default; comment out this line to re-enable: + open-pull-requests-limit: 0 + directory: / + schedule: + interval: monthly + # select only minor + patch by excluding major. dependabot doesn't appear + # to have an include-only rule, so we have to do it by exclusion. + ignore: + - dependency-name: "*" + update-types: + - "version-update:semver-major" + # never bump the version in `Cargo.toml` for minor/patch upgrades; it + # should only change when the major version changes to avoid requiring + # downstream packages from also running a `cargo update` (and possibly + # bumping MSRV unnecessarily as a result). + # + # TODO: https://github.com/dependabot/dependabot-core/issues/4009 + # versioning-strategy: "increase-if-necessary" + versioning-strategy: "lockfile-only" + groups: + # note that since this is perfectly disjoint with the `ignore` rule, all + # minor/patch updates will end up in a single group, and thus in a single + # PR. grouping all of these together only (generally) works because the + # Rust community is fairly good about respecting semver. + cargo-update: + update-types: + - "minor" + - "patch" From 799c99e0cf77d2289ab47e84fa3b8296cfc5beb1 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sun, 7 Jul 2024 10:18:50 +0200 Subject: [PATCH 69/73] Revert "More intelligent dependabot behaviour" This reverts commit dcf68836181145511a35a269e8392d0a0f0c61e1. Will not work due to https://github.com/dependabot/dependabot-core/issues/10160 --- .github/dependabot.yml | 59 +++++------------------------------------- 1 file changed, 6 insertions(+), 53 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f9d7d1c..d0f091e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,63 +4,16 @@ updates: directory: / schedule: interval: daily - # Cargo major version update notifications (PRs) we always want - package-ecosystem: cargo directory: / - ignore: - - dependency-name: "*" - update-types: - - "version-update:semver-patch" - - "version-update:semver-minor" schedule: - # we want to know about them immediately interval: daily - groups: - # we group major bumps for dev-dependencies together in case there are - # related groups of breaking changes. that _can_ be the case for - # production dependencies too, but there one should be more diligent - # about each major bump in case it constitutes a breaking change to the - # current crate too. - major-dev: - dependency-type: "development" - update-types: - - "major" - # patch and minor updates don't matter for libraries, as consumers of a - # library build with their own lockfile, rather than the version specified in - # this library's lockfile. so for libraries (which is most crates), we should - # never update non-major versions, and so the following rule is disabled by - # default. - # - # if your package has binaries, enable this rule by commenting out the - # `open-pull-requests-limit` line. this will open a PR once a month that - # effectively runs `cargo update` to ensure that the binaries are built with - # the exact set of dependencies and those are up to date. - - package-ecosystem: cargo - # this rule is disabled by default; comment out this line to re-enable: - open-pull-requests-limit: 0 - directory: / - schedule: - interval: monthly - # select only minor + patch by excluding major. dependabot doesn't appear - # to have an include-only rule, so we have to do it by exclusion. ignore: - dependency-name: "*" + # patch and minor updates don't matter for libraries as consumers of this library build + # with their own lockfile, rather than the version specified in this library's lockfile + # remove this ignore rule if your package has binaries to ensure that the binaries are + # built with the exact set of dependencies and those are up to date. update-types: - - "version-update:semver-major" - # never bump the version in `Cargo.toml` for minor/patch upgrades; it - # should only change when the major version changes to avoid requiring - # downstream packages from also running a `cargo update` (and possibly - # bumping MSRV unnecessarily as a result). - # - # TODO: https://github.com/dependabot/dependabot-core/issues/4009 - # versioning-strategy: "increase-if-necessary" - versioning-strategy: "lockfile-only" - groups: - # note that since this is perfectly disjoint with the `ignore` rule, all - # minor/patch updates will end up in a single group, and thus in a single - # PR. grouping all of these together only (generally) works because the - # Rust community is fairly good about respecting semver. - cargo-update: - update-types: - - "minor" - - "patch" + - "version-update:semver-patch" + - "version-update:semver-minor" From 5ed5ed26c75685740abb4af25c17b18cc091edcf Mon Sep 17 00:00:00 2001 From: Charles Edward Gagnon <76854355+carloskiki@users.noreply.github.com> Date: Sun, 18 Aug 2024 03:28:39 -0400 Subject: [PATCH 70/73] documentation check with `cargo-docs-rs` (#23) --- .github/workflows/check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 98834bf..5251954 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -84,10 +84,10 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly - - name: cargo doc - run: cargo doc --no-deps --all-features - env: - RUSTDOCFLAGS: --cfg docsrs + - name: Install cargo-docs-rs + uses: dtolnay/install@cargo-docs-rs + - name: cargo docs-rs + run: cargo docs-rs hack: # cargo-hack checks combinations of feature flags to ensure that features are all additive # which is required for feature unification From c6a836118612ec10478df972f523000eb4387339 Mon Sep 17 00:00:00 2001 From: cospectrum Date: Sat, 14 Sep 2024 11:18:31 +0300 Subject: [PATCH 71/73] fix shell-check (#24) --- .github/workflows/safety.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 6bdd055..83da574 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -59,7 +59,7 @@ jobs: with: submodules: true - run: | - echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> $GITHUB_ENV + echo "NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)" >> "$GITHUB_ENV" - name: Install ${{ env.NIGHTLY }} uses: dtolnay/rust-toolchain@master with: From c3d310c46ffcd6506298cb879d52a865f0613dc0 Mon Sep 17 00:00:00 2001 From: Zykino <5694-Zykino@users.noreply.framagit.org> Date: Mon, 14 Oct 2024 00:21:06 +0200 Subject: [PATCH 72/73] CI only on wasm (our target) This is a bit brute force. I suspect test will not work --- .cargo/config.toml | 2 +- .github/workflows/check.yml | 8 ++++++++ .github/workflows/nostd.yml | 30 ------------------------------ .github/workflows/safety.yml | 5 +++++ .github/workflows/scheduled.yml | 4 ++++ .github/workflows/test.yml | 8 ++++++++ 6 files changed, 26 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/nostd.yml diff --git a/.cargo/config.toml b/.cargo/config.toml index 6b77899..6b509f5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -target = "wasm32-wasi" +target = "wasm32-wasip1" diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5251954..cba67cf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -31,6 +31,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: rustfmt - name: cargo fmt --check run: cargo fmt --check @@ -52,6 +53,7 @@ jobs: - name: Install ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.toolchain }} components: clippy - name: cargo clippy @@ -69,6 +71,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: rustfmt - name: cargo-semver-checks uses: obi1kenobi/cargo-semver-checks-action@v2 @@ -84,6 +87,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: Install cargo-docs-rs uses: dtolnay/install@cargo-docs-rs - name: cargo docs-rs @@ -99,6 +104,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo install cargo-hack uses: taiki-e/install-action@cargo-hack # intentionally no target specifier; see https://github.com/jonhoo/rust-ci-conf/pull/4 @@ -121,6 +128,7 @@ jobs: - name: Install ${{ matrix.msrv }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.msrv }} - name: cargo +${{ matrix.msrv }} check run: cargo check diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml deleted file mode 100644 index c12227a..0000000 --- a/.github/workflows/nostd.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This workflow checks whether the library is able to run without the std library (e.g., embedded). -# This entire file should be removed if this crate does not support no-std. See check.yml for -# information about how the concurrency cancellation and workflow triggering works -permissions: - contents: read -on: - push: - branches: [main] - pull_request: -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true -name: no-std -jobs: - nostd: - runs-on: ubuntu-latest - name: ${{ matrix.target }} - strategy: - matrix: - target: [thumbv7m-none-eabi, aarch64-unknown-none] - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: rustup target add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} - - name: cargo check - run: cargo check --target ${{ matrix.target }} --no-default-features diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml index 83da574..33c7a6a 100644 --- a/.github/workflows/safety.yml +++ b/.github/workflows/safety.yml @@ -24,6 +24,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - run: | # to get the symbolizer for debug symbol resolution sudo apt install llvm @@ -63,6 +65,7 @@ jobs: - name: Install ${{ env.NIGHTLY }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ env.NIGHTLY }} components: miri - name: cargo miri test @@ -77,6 +80,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo test --test loom run: cargo test --release --test loom env: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 02aa275..104ba4d 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -24,6 +24,8 @@ jobs: submodules: true - name: Install nightly uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile @@ -48,6 +50,8 @@ jobs: - name: Install beta if: hashFiles('Cargo.lock') != '' uses: dtolnay/rust-toolchain@beta + with: + target: wasm32-wasip1 - name: cargo update if: hashFiles('Cargo.lock') != '' run: cargo update diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f7540ae..cdd483e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,7 @@ jobs: - name: Install ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: + target: wasm32-wasip1 toolchain: ${{ matrix.toolchain }} - name: cargo generate-lockfile # enable this ci template to run regardless of whether the lockfile is checked in or not @@ -74,8 +75,12 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: Install nightly for -Zminimal-versions uses: dtolnay/rust-toolchain@nightly + with: + target: wasm32-wasip1 - name: rustup default stable run: rustup default stable - name: cargo update -Zminimal-versions @@ -102,6 +107,8 @@ jobs: submodules: true - name: Install stable uses: dtolnay/rust-toolchain@stable + with: + target: wasm32-wasip1 - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile @@ -138,6 +145,7 @@ jobs: - name: Install stable uses: dtolnay/rust-toolchain@stable with: + target: wasm32-wasip1 components: llvm-tools-preview - name: cargo install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov From af867992e8b09ea1812a7668e780d4ceb49fbaa7 Mon Sep 17 00:00:00 2001 From: Zykino <5694-Zykino@users.noreply.framagit.org> Date: Sat, 19 Oct 2024 13:48:12 +0200 Subject: [PATCH 73/73] Fix CI issues --- plugin-dev-workspace.kdl | 2 +- src/action/mod.rs | 1 + src/main.rs | 6 +++--- src/ui/mod.rs | 30 ++++++++---------------------- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/plugin-dev-workspace.kdl b/plugin-dev-workspace.kdl index 584c55e..82ddd0f 100644 --- a/plugin-dev-workspace.kdl +++ b/plugin-dev-workspace.kdl @@ -9,7 +9,7 @@ layout { pane command="dash" name="Compile and reload plugin" { // args "-c" "cargo build && zellij action start-or-reload-plugin file:/mnt/Data/Code/Target/Cargo/wasm32-wasi/debug/zellij-console.wasm" // if you have "watchexec" installed, you can comment the above line and uncomment the below one to build + reload the plugin on fs changes - args "-c" "watchexec --quiet --clear --watch src -- 'cargo build --quiet && zellij action start-or-reload-plugin file:/mnt/Data/Code/Target/Cargo/wasm32-wasi/debug/zellij-console.wasm'" + args "-c" "watchexec --quiet --clear --watch src -- 'cargo build --quiet && zellij action start-or-reload-plugin file:/mnt/Data/Code/Target/Cargo/wasm32-wasip1/debug/zellij-console.wasm'" size "25%" } } diff --git a/src/action/mod.rs b/src/action/mod.rs index 74f0624..5765268 100644 --- a/src/action/mod.rs +++ b/src/action/mod.rs @@ -381,6 +381,7 @@ impl ActionList { ActionList::iter().filter(Self::usable_in_any) } + #[allow(dead_code)] pub(crate) fn filter_all() -> impl Iterator { ActionList::iter().filter(Self::usable_in_all) } diff --git a/src/main.rs b/src/main.rs index e09c6e5..85cc2a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ struct State { should_open_floating: bool, search_filter: EnvironmentFrom, display: DisplaySize, - zellij_state: ZellijState, + // zellij_state: ZellijState, } register_plugin!(State); @@ -103,7 +103,7 @@ impl ZellijPlugin for State { } fn pipe(&mut self, pipe_message: PipeMessage) -> bool { - let mut should_render = false; // TODO: needed sometimes? apparently not since changing the action already update the interface… but check it… (if needed add when `set`ting the action?) + let should_render = false; // TODO: needed sometimes? apparently not since changing the action already update the interface… but check it… (if needed add when `set`ting the action?) let interface = Interface::Pipe; eprintln!("received message from pipe {:#?}", pipe_message); @@ -138,7 +138,7 @@ impl ZellijPlugin for State { // This is annoying for the elses if let ActionList::Unavailable { action, - calling_interface, + calling_interface: _, } = self.action.action() { let res = format!("{}", action); diff --git a/src/ui/mod.rs b/src/ui/mod.rs index e1d8106..bd6011c 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -1,13 +1,13 @@ -use std::fmt::{Debug, Display, Formatter}; -use strum::{EnumMessage, EnumProperty}; +use std::fmt::{Display, Formatter}; +use strum::EnumMessage; -use zellij_tile::prelude::{ui_components::*, CommandToRun, FileToOpen, Palette}; +use zellij_tile::prelude::{ui_components::*, CommandToRun, FileToOpen}; use crate::action::{ActionList, Interface, Selection}; use crate::{EnvironmentFrom, State}; const WHITE: u8 = 15; -const BLACK: u8 = 16; +// const BLACK: u8 = 16; const REQUIRED_COLOR: usize = 2; const OPTIONAL_COLOR: usize = 3; @@ -107,7 +107,7 @@ impl Display for ActionList { .indent(1) .color_range(2, 0..shortcut_msg.len()), ); - + if !variant.usable_in_all() { result.push( NestedListItem::new(format!( @@ -221,7 +221,7 @@ impl State { "{} {}{}\n{}\n", serialize_text(&Text::new("PROMPT:").color_range(1, 0..6)), self.action.as_str(), - styled_text_background(WHITE, " "), // "Cursor" representation + cursor(WHITE, " "), self.action.action(), ) } @@ -261,21 +261,7 @@ impl State { } } -pub fn bold(text: &str) -> String { - format!("\u{1b}[1m{}\u{1b}[m", text) -} - -pub fn styled_text(foreground_color: u8, background_color: u8, text: &str) -> String { - format!( - "\u{1b}[38;5;{};48;5;{}m{}\u{1b}[m", - foreground_color, background_color, text - ) -} - -pub fn styled_text_foreground(foreground_color: u8, text: &str) -> String { - format!("\u{1b}[38;5;{}m{}\u{1b}[m", foreground_color, text) -} - -pub fn styled_text_background(background_color: u8, text: &str) -> String { +pub fn cursor(background_color: u8, text: &str) -> String { + // format!("\\033[?25h") // Cursor, see https://poor.dev/blog/terminal-anatomy/ format!("\u{1b}[48;5;{}m{}\u{1b}[m", background_color, text) }