Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install github_changelog_generator
run: gem install github_changelog_generator
- name: Gen changelog
run: github_changelog_generator -t ${{ secrets.GITHUB_TOKEN }} -u casbin -p casbin-rs
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'changelog: auto update by ci'
file_pattern: CHANGELOG.md
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- name: Install github_changelog_generator
run: gem install github_changelog_generator

- name: Gen changelog
run: github_changelog_generator -t ${{ secrets.GITHUB_TOKEN }} -u casbin -p casbin-rs

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'changelog: auto update by ci'
file_pattern: CHANGELOG.md
42 changes: 30 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ jobs:
name: Auto Build CI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [beta, stable]
steps:
- name: Checkout Repository
uses: actions/checkout@master
uses: actions/checkout@v4
- name: Install Rust toolchain ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
Expand All @@ -28,28 +29,43 @@ jobs:
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true

- name: Setup wasm tools on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
# Ensure the wasm target is added and install wasm-pack/wasm-bindgen on Windows
rustup target add wasm32-unknown-unknown --toolchain ${{ matrix.rust }}
# Try to install wasm-pack and wasm-bindgen-cli via cargo; if running as non-admin this should work
cargo install wasm-pack --force || Write-Host "wasm-pack install failed"
cargo install wasm-bindgen-cli --force || Write-Host "wasm-bindgen-cli install failed"
# Work around https://github.com/actions/cache/issues/403 by using GNU tar
# instead of BSD tar.
- name: Install GNU tar
if: matrix.os == 'macOS-latest'
- name: Install GNU tar (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
# Install gnu-tar for both Intel and Apple Silicon and add to PATH
brew install gnu-tar || brew reinstall gnu-tar
if [ -d "/usr/local/opt/gnu-tar/libexec/gnubin" ]; then
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
elif [ -d "/opt/homebrew/opt/gnu-tar/libexec/gnubin" ]; then
echo PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
fi
- name: Cache cargo registry
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}-v1
- name: Cache cargo index
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}-v1
- name: Cache cargo build
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: target
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-${{ secrets.CACHE_VERSION }}
key: ${{ matrix.os }}-${{ matrix.rust }}-cargo-build-target-${{ hashFiles('**/Cargo.toml') }}-v1
- name: Release build async-std
uses: actions-rs/cargo@v1
with:
Expand All @@ -72,6 +88,8 @@ jobs:
args: --no-default-features --features runtime-tokio,cached,glob,ip,watcher,logging,incremental,explain
- name: Cargo Check Wasm
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: --cfg=wasm_js
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@master
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -32,6 +32,6 @@ jobs:
cargo tarpaulin --no-default-features --features runtime-async-std,cached,glob,ip,watcher,logging,incremental,explain

- name: Upload to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: run benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
Expand All @@ -17,13 +17,13 @@ jobs:
override: true
profile: minimal
- name: Cache cargo
uses: actions/cache@v2.1.4
uses: actions/cache@v3
with:
path: |
target
~/.cargo/git
~/.cargo/registry
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-v1
- uses: smrpn/criterion-compare-action@move_to_actions
with:
cwd: benches
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
Expand Down
Loading