From 1c486b2c73cb2ae896dd77e0f0ec060a47f15cd7 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 12:10:07 -0700 Subject: [PATCH 01/62] 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 00000000..7a4789ee --- /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/62] Merge another codecov --- codecov.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/codecov.yml b/codecov.yml index 7a4789ee..7b19db20 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/62] Merge another codecov --- codecov.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/codecov.yml b/codecov.yml index 7b19db20..7864a9ea 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/62] Merge another codecov --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 7864a9ea..1e0fb066 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/62] Merge another codecov --- codecov.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/codecov.yml b/codecov.yml index 1e0fb066..ff4f571d 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/62] 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/62] 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 00000000..08afae92 --- /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/62] 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 00000000..6effa8c8 --- /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/62] 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 6effa8c8..f07bde13 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/62] 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 f07bde13..677ad586 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/62] 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 00000000..2d8c1fe9 --- /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/62] 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 2d8c1fe9..f6acf15d 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/62] 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 f6acf15d..d9ca4c00 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/62] 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 d9ca4c00..c2c3920d 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/62] 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 00000000..9246b406 --- /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/62] 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 00000000..69ce0df1 --- /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/62] 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 00000000..b4cf571b --- /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/62] 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 00000000..e79ab42a --- /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/62] 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 00000000..aebe1f82 --- /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/62] 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 aebe1f82..ee1b2bf9 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/62] 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 ee1b2bf9..4a3a92eb 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/62] 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 4a3a92eb..ac0dc41f 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/62] 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 00000000..433e11d2 --- /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/62] 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 00000000..bbcb4758 --- /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/62] 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 bbcb4758..285499b7 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/62] 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 00000000..74a877c0 --- /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/62] 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 74a877c0..d3320bc7 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/62] 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 d3320bc7..648b6a1f 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/62] 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 00000000..a82ac617 --- /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/62] 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 a82ac617..5dd762cb 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/62] 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 5dd762cb..de5d3ea9 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/62] 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 de5d3ea9..b247ef60 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/62] 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 08afae92..5604b7ee 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 c2c3920d..3e45d183 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 9246b406..8cfe45d5 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 69ce0df1..a9669130 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 b4cf571b..f3ed6ace 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 e79ab42a..ae9539a4 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 ac0dc41f..9758e26c 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 433e11d2..409ae73a 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 285499b7..5fc3453e 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 648b6a1f..7a583f29 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/62] 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 677ad586..375f7a31 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 3e45d183..ac5e18e0 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 f3ed6ace..0a558a90 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 9758e26c..d6d90463 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 5fc3453e..c56b6995 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 b247ef60..dfc18194 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/62] 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 c56b6995..db3590bd 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/62] 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 00000000..c67a3174 --- /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 00000000..5a86ccac --- /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/62] 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 00000000..81c3a01b --- /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 375f7a31..00000000 --- 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 ac5e18e0..00000000 --- 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 c67a3174..00000000 --- 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 0a558a90..00000000 --- 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 d6d90463..00000000 --- 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 db3590bd..00000000 --- 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 5a86ccac..00000000 --- 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 00000000..bb39a221 --- /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 7a583f29..00000000 --- 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 dfc18194..83645f88 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/62] 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/62] 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 5604b7ee..00000000 --- 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 8cfe45d5..00000000 --- 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 a9669130..00000000 --- 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 ae9539a4..00000000 --- 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 00000000..86fc9eea --- /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/62] 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 bb39a221..20229ba9 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/62] 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 20229ba9..a5f53110 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/62] 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 81c3a01b..560e9e28 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/62] 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 00000000..22cfb43c --- /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/62] 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 22cfb43c..9c60153e 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/62] 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 9c60153e..8139a93a 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/62] 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 83645f88..9569167d 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/62] 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 560e9e28..da175c28 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 409ae73a..235df268 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 86fc9eea..77f56a48 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 a5f53110..e341e9b2 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 9569167d..53db8406 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/62] 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 da175c28..d25da88b 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/62] 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 d25da88b..29fc8881 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 235df268..397a2da6 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 77f56a48..6c973c0f 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 e341e9b2..2c156957 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 53db8406..4435fd7b 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/62] 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 29fc8881..406ba9bd 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 397a2da6..7efae0f3 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 6c973c0f..4fa7ad74 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 2c156957..0215432a 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 4435fd7b..8aa4488f 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/62] 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 4fa7ad74..edf40e56 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/62] 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 406ba9bd..a687dfa3 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/62] 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 8aa4488f..c675b388 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/62] 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 a687dfa3..3fb97ada 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 7efae0f3..32d56c3d 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 edf40e56..9c7aeee7 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 0215432a..d4e19dda 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 c675b388..4d0417cb 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/62] [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 9c7aeee7..eb5a5d64 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 4255fc83673a44ad1a6462fedff9144e05c64c77 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:08:48 -0700 Subject: [PATCH 56/62] ci: check msrv against 1.32.0 --- .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 3fb97ada..88b54196 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.32.0] name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v3 From c237241c476f39ac7ef962b3d8b12de34b77ab7f Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:10:07 -0700 Subject: [PATCH 57/62] style: run cargo fmt to fix formatting --- strum_macros/src/helpers/case_style.rs | 3 ++- strum_macros/src/macros/enum_messages.rs | 19 +++++++++++-------- .../src/macros/strings/from_string.rs | 2 +- strum_tests/tests/enum_message.rs | 5 ++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/strum_macros/src/helpers/case_style.rs b/strum_macros/src/helpers/case_style.rs index d714f863..40d6d17c 100644 --- a/strum_macros/src/helpers/case_style.rs +++ b/strum_macros/src/helpers/case_style.rs @@ -1,5 +1,6 @@ use heck::{ - ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase, ToUpperCamelCase, ToTrainCase, + ToKebabCase, ToLowerCamelCase, ToShoutySnakeCase, ToSnakeCase, ToTitleCase, ToTrainCase, + ToUpperCamelCase, }; use std::str::FromStr; use syn::{ diff --git a/strum_macros/src/macros/enum_messages.rs b/strum_macros/src/macros/enum_messages.rs index c0561085..2dad4117 100644 --- a/strum_macros/src/macros/enum_messages.rs +++ b/strum_macros/src/macros/enum_messages.rs @@ -74,14 +74,17 @@ pub fn enum_message_inner(ast: &DeriveInput) -> syn::Result { if !documentation.is_empty() { let params = params.clone(); // Strip a single leading space from each documentation line. - let documentation: Vec = documentation.iter().map(|lit_str| { - let line = lit_str.value(); - if line.starts_with(' ') { - LitStr::new(&line.as_str()[1..], lit_str.span()) - } else { - lit_str.clone() - } - }).collect(); + let documentation: Vec = documentation + .iter() + .map(|lit_str| { + let line = lit_str.value(); + if line.starts_with(' ') { + LitStr::new(&line.as_str()[1..], lit_str.span()) + } else { + lit_str.clone() + } + }) + .collect(); if documentation.len() == 1 { let text = &documentation[0]; documentation_arms diff --git a/strum_macros/src/macros/strings/from_string.rs b/strum_macros/src/macros/strings/from_string.rs index 2d255917..4b9a7219 100644 --- a/strum_macros/src/macros/strings/from_string.rs +++ b/strum_macros/src/macros/strings/from_string.rs @@ -79,7 +79,7 @@ pub fn from_string_inner(ast: &DeriveInput) -> syn::Result { phf_exact_match_arms.push(quote! { #serialization => #name::#ident #params, }); if is_ascii_case_insensitive { - // Store the lowercase and UPPERCASE variants in the phf map to capture + // Store the lowercase and UPPERCASE variants in the phf map to capture let ser_string = serialization.value(); let lower = diff --git a/strum_tests/tests/enum_message.rs b/strum_tests/tests/enum_message.rs index a5f7bde4..40aa7576 100644 --- a/strum_tests/tests/enum_message.rs +++ b/strum_tests/tests/enum_message.rs @@ -47,7 +47,10 @@ fn only_detailed_message() { #[test] fn documentation() { - assert_eq!("I eat birds.\n\nAnd fish.\n", (Pets::Cat).get_documentation().unwrap()); + assert_eq!( + "I eat birds.\n\nAnd fish.\n", + (Pets::Cat).get_documentation().unwrap() + ); assert_eq!("I'm a fish.", (Pets::Fish).get_documentation().unwrap()); assert_eq!("I'm a bird.", (Pets::Bird).get_documentation().unwrap()); } From 08ac77816656c8205751610e7dd68590c3bd4bb8 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:29:03 -0700 Subject: [PATCH 58/62] ci: add 1.32 and nightly to the OS text matrix --- .github/workflows/test.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d0417cb..ab8117a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,15 @@ concurrency: name: test jobs: required: + # test on ubuntu, fail fast if this fails, as it's unlikely that the other + # OSes will succed. This is the only target that builds the docs, as it's + # not necessary to build this on every OS. runs-on: ubuntu-latest name: ubuntu / ${{ matrix.toolchain }} strategy: + fail-fast: true matrix: - toolchain: [stable, beta] + toolchain: [1.32.0, stable, beta, nightly] steps: - uses: actions/checkout@v3 with: @@ -30,6 +34,7 @@ jobs: # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked run: cargo test --locked --all-features --all-targets + # Cargo test --all-targets doesn't run doc tests # https://github.com/rust-lang/cargo/issues/6669 - name: cargo test --doc run: cargo test --locked --all-features --doc @@ -52,17 +57,20 @@ jobs: run: cargo test --locked --all-features --all-targets os-check: runs-on: ${{ matrix.os }} - name: ${{ matrix.os }} / stable + name: ${{ matrix.os }} / ${{ matrix.toolchain}} strategy: fail-fast: false matrix: os: [macos-latest, windows-latest] + toolchain: [1.32.0, stable, beta, nightly] steps: - uses: actions/checkout@v3 with: submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable + - name: Install ${{ matrix.toolchain}} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain}} - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile From d6af9fd7e479219dbb6a5479ebae63781637d1a6 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:44:27 -0700 Subject: [PATCH 59/62] ci: do not test 1.32.0 against all-features test_phf feature is incompatible with 1.32 as siphasher crate does not build --- .github/workflows/test.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ab8117a4..ce3b3209 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,11 +32,17 @@ jobs: if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile # https://twitter.com/jonhoo/status/1571290371124260865 + - name: cargo test --locked --all-features + # test_phf feature is incompatible with 1.32 + if: matrix.toolchain != '1.32.0' + run: cargo test --locked --all-features --all-targets --verbose - name: cargo test --locked - run: cargo test --locked --all-features --all-targets + if: matrix.toolchain == '1.32.0' + run: cargo test --locked --all-targets --verbose # Cargo test --all-targets doesn't run doc tests # https://github.com/rust-lang/cargo/issues/6669 - name: cargo test --doc + if: matrix.toolchain != '1.32.0' run: cargo test --locked --all-features --doc minimal: runs-on: ubuntu-latest @@ -74,8 +80,13 @@ jobs: - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile - - name: cargo test - run: cargo test --locked --all-features --all-targets + - name: cargo test --locked --all-features + # test_phf feature is incompatible with 1.32 + if: matrix.toolchain != '1.32.0' + run: cargo test --locked --all-features --all-targets --verbose + - name: cargo test --locked + if: matrix.toolchain == '1.32.0' + run: cargo test --locked --all-targets --verbose coverage: runs-on: ubuntu-latest name: ubuntu / stable / coverage From ed4fda4545aec1424cf3784258ea661d67520971 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:46:44 -0700 Subject: [PATCH 60/62] ci: remove safety.yml We do not have unsafe code in strum, so this is not necessary --- .github/workflows/safety.yml | 78 ------------------------------------ 1 file changed, 78 deletions(-) delete mode 100644 .github/workflows/safety.yml diff --git a/.github/workflows/safety.yml b/.github/workflows/safety.yml deleted file mode 100644 index eb5a5d64..00000000 --- a/.github/workflows/safety.yml +++ /dev/null @@ -1,78 +0,0 @@ -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 -name: safety -jobs: - sanitizers: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Install nightly - uses: dtolnay/rust-toolchain@nightly - - 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 - # 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 - # 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() - run: cargo test --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: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.NIGHTLY }} - components: miri - - name: cargo miri test - run: cargo miri test - env: - MIRIFLAGS: "" - loom: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - name: Install stable - uses: dtolnay/rust-toolchain@stable - - name: cargo test --test loom - run: cargo test --release --test loom - env: - LOOM_MAX_PREEMPTIONS: 2 - RUSTFLAGS: "--cfg loom" From ede610fd341a72b34eba839ed36f902b08b4da84 Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 13:55:03 -0700 Subject: [PATCH 61/62] ci: exclude strum_tests from no-std checks no-std checks fail to build textwrap, which is a required dependency of structopts --- .github/workflows/nostd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nostd.yml b/.github/workflows/nostd.yml index 32d56c3d..d9ba43a0 100644 --- a/.github/workflows/nostd.yml +++ b/.github/workflows/nostd.yml @@ -25,4 +25,5 @@ jobs: - name: rustup target add ${{ matrix.target }} run: rustup target add ${{ matrix.target }} - name: cargo check - run: cargo check --target ${{ matrix.target }} --no-default-features + # exclude strum_tests as textwrap (used by structopt) is not compatible with no-std + run: cargo check --target ${{ matrix.target }} --no-default-features -p strum -p strum_nostd_tests From 0166b90a9737fccdda9beab9276ad84268e1910f Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Tue, 16 May 2023 14:31:18 -0700 Subject: [PATCH 62/62] fix: strum_nostd_tests should not include std Before this change, attempting to build strum_no_std would include std in the default features of strum, which would prevent it building --- strum_nostd_tests/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strum_nostd_tests/Cargo.toml b/strum_nostd_tests/Cargo.toml index 1c0ee470..9ed4e215 100644 --- a/strum_nostd_tests/Cargo.toml +++ b/strum_nostd_tests/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -strum = { path = "../strum", features = ["derive"] } +strum = { path = "../strum", default-features = false, features = ["derive"] } strum_macros = { path = "../strum_macros", features = [] } [dev-dependencies]