diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..c75e875a00b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index b03e2829ac3..5f28e13d0ea 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -24,7 +24,7 @@ jobs: name: Security Audit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install rust @@ -43,7 +43,7 @@ jobs: - licenses - sources steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: EmbarkStudios/cargo-deny-action@v1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07dc3aa6ffa..0dd551d9154 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest needs: [test, rustfmt, clippy, docs] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 # fetch tags for publish @@ -43,7 +43,7 @@ jobs: rust: ["", nightly] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install rust @@ -57,7 +57,7 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: dtolnay/rust-toolchain@master @@ -70,10 +70,9 @@ jobs: name: Prettier runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check formatting with Prettier - # Explicit commit, because this isn't tagged yet. - uses: actionsx/prettier@3d9f7c3fa44c9cb819e68292a328d7f4384be206 + uses: actionsx/prettier@v3 with: args: -c . @@ -81,7 +80,7 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: dtolnay/rust-toolchain@master @@ -101,7 +100,7 @@ jobs: name: Docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d1446517ce5..8cfc0ce9537 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,9 +1,11 @@ -# This doesn't work currently there is a bug in the output of grcov on: push: branches: - main - - trying + pull_request: + +env: + CI_TWITCH_API_FEATURES: "twitch_oauth2/all all unsupported deny_unknown_fields ureq" name: Code Coverage jobs: @@ -11,10 +13,8 @@ jobs: name: Run test coverage runs-on: ubuntu-latest continue-on-error: true - # cov is broken upstream, see https://github.com/rust-lang/rust/issues/79645, fix in https://github.com/rust-lang/rust/issues/93054 - if: "false" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Toolchain setup @@ -23,27 +23,32 @@ jobs: toolchain: nightly components: llvm-tools-preview - uses: Swatinem/rust-cache@v2 + - name: Install cargo-llvm-cov run: curl -LsSf https://github.com/taiki-e/cargo-llvm-cov/releases/latest/download/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin + - name: Generate code coverage for tests - run: cargo llvm-cov --no-report --tests --features "twitch_oauth2/all all unsupported deny_unknown_fields trace_unknown_fields" + run: cargo llvm-cov --no-report --tests --features "${{ env.CI_TWITCH_API_FEATURES }} _all trace_unknown_fields" - name: Generate code coverage for tests without any features run: cargo llvm-cov --no-report --tests - name: Generate code coverage for examples - run: cargo llvm-cov --no-report --examples --features "twitch_oauth2/all all unsupported deny_unknown_fields trace_unknown_fields" - #- name: Generate code coverage for docs - # run: cargo llvm-cov --no-report --doc --features "twitch_oauth2/all all unsupported deny_unknown_fields trace_unknown_fields" + run: cargo llvm-cov --no-report --examples --features "${{ env.CI_TWITCH_API_FEATURES }} _all trace_unknown_fields" + # doctests take too long to complete + # - name: Generate code coverage for docs + # run: cargo llvm-cov --no-report --doc --features "${{ env.CI_TWITCH_API_FEATURES }} _all" + - name: Merge lcov.info - run: cargo llvm-cov --no-run --lcov --ignore-filename-regex "twitch_oauth2" --output-path lcov.info - - name: Determine PR number - if: ${{ github.ref == 'refs/heads/trying' }} - run: git log -1 --pretty=format:"%s" | awk '{ print "PR_NUMBER=" substr($NF,2,length($NF)-2) }' >> $GITHUB_ENV + run: cargo llvm-cov report --lcov --ignore-filename-regex "twitch_oauth2" --output-path lcov.info + + # - name: Determine PR number + # if: ${{ github.event_name == 'pull_request' }} + # run: git log -1 --pretty=format:"%s" | awk '{ print "PR_NUMBER=" substr($NF,2,length($NF)-2) }' >> $GITHUB_ENV # - name: Determine actual commit # if: ${{ github.ref == 'refs/heads/trying' }} # run: git rev-parse HEAD~1 | awk '{ print "ACTUAL_COMMIT_SHA=" $NF }' >> $GITHUB_ENV - name: Upload to codecov.io - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./lcov.info - override_pr: ${{env.PR_NUMBER}} - # override_commit: ${{env.ACTUAL_COMMIT_SHA}} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 52b8760c559..b7e69d029f6 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -7,7 +7,7 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - uses: dtolnay/rust-toolchain@master @@ -19,7 +19,7 @@ jobs: - name: move index.html run: cp ./docs/index.html ./target/doc/index.html - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./target/doc