Skip to content

Commit

Permalink
Use rustup command instead of actions-rs/toolchain in github actions
Browse files Browse the repository at this point in the history
actions-rs/toolchain has been archived and has not been maintained.
  • Loading branch information
kubo committed Mar 13, 2024
1 parent 847c1b2 commit b58b094
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 28 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ jobs:
gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: update rust
run: |
rustup install stable
- name: get metadata.docs.rs.features in Cargo.toml
run: |
docs_features=$(cargo read-manifest | jq -r '.metadata.docs.rs.features | join(",")')
echo DOCS_FEATURES=$docs_features
echo DOCS_FEATURES=$docs_features >> $GITHUB_ENV
- uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --features "${{ env.DOCS_FEATURES }}"
- name: cargo doc
run: |
cargo doc --no-deps --features "${{ env.DOCS_FEATURES }}"
- name: push docs
run: |
git submodule deinit --all
git fetch --depth=1 origin gh-pages
git checkout gh-pages
rm -rf docs
Expand All @@ -34,7 +34,5 @@ jobs:
sed -i -E 's/(Version [0-9]+\.[0-9]+\.[0-9]+)/\1<br\/>(in development)/g' docs/oracle/index.html docs/oracle/all.html
git config --local user.email "docs-action@github.com"
git config --local user.name "GitHub Action (docs)"
git add docs
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -m 'Add docs'
git push origin gh-pages
git diff --quiet || (git add docs && git commit -m 'Add docs' && git push origin gh-pages && echo Add docs)
33 changes: 16 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ jobs:
msrv: ${{ steps.msrv.outputs.msrv }}
rust_toolchains: ${{ steps.msrv.outputs.rust_toolchains }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: msrv
name: Get minimum supported rust version in Cargo.toml
run: |
MSRV=$(sed -n -e 's/rust-version *= *"\(.*\)"/\1/p' Cargo.toml)
echo "::set-output name=msrv::$MSRV]"
echo "::set-output name=rust_toolchains::[\"stable\", \"$MSRV\"]"
echo "rust_toolchains=[\"stable\", \"$MSRV\"]" >> $GITHUB_OUTPUT
tests:
needs: msrv
Expand Down Expand Up @@ -43,7 +42,7 @@ jobs:
--health-retries 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true

Expand Down Expand Up @@ -82,24 +81,24 @@ jobs:
echo ODPIC_TEST_CONNECT_STRING=//$ORACLE_IP_ADDRESS:1521/XEPDB1 >> $GITHUB_ENV
echo NLS_LANG=AMERICAN_AMERICA.AL32UTF8 >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust_toolchain }}
target: x86_64-pc-windows-gnu
override: true
- name: install rust
run: |
rustup install ${{ matrix.rust_toolchain }}
rustup target add x86_64-pc-windows-gnu --toolchain ${{ matrix.rust_toolchain }}
- name: Downgrade chrono to 0.4.31, whose MSRV is 1.57.0, if the rust toolchain isn't stable
if: matrix.rust_toolchain != 'stable'
run: |
cargo update -p chrono --precise 0.4.31
- name: Create Oracle users and schema
run: |
sqlplus sys/sys_passwd as sysdba @tests/SetupTest.sql < /dev/null
- name: cargo test (x86_64-unknown-linux-gnu)
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ env.rust_features }} -- --nocapture
run: |
rustup run ${{ matrix.rust_toolchain }} cargo test --features ${{ env.rust_features }} -- --nocapture
- name: cargo test (x86_64-pc-windows-gnu)
uses: actions-rs/cargo@v1
with:
command: test
args: --target x86_64-pc-windows-gnu --features ${{ env.rust_features }} -- --nocapture
run: |
rustup run ${{ matrix.rust_toolchain }} cargo test --target x86_64-pc-windows-gnu --features ${{ env.rust_features }} -- --nocapture

0 comments on commit b58b094

Please sign in to comment.