Skip to content

Commit

Permalink
Update GH action to use dtolnay/rust-toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
iesahin committed Nov 29, 2024
1 parent 6b28b6d commit 9862b3b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 55 deletions.
94 changes: 39 additions & 55 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# test-args: --no-fail-fast
# test-args: --all-features
# benches: true
coverage: true
coverage: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand All @@ -56,10 +56,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v1

# - name: Install required packages
#
# run: sudo apt install -y inotify-tools ripgrep s3cmd

- name: Install required packages
run: |
brew install --head s3cmd # 2.3.0 has a bug with Python 3.12
Expand All @@ -82,18 +78,13 @@ jobs:
run: ls -R $HOME/.ssh ; cat $HOME/.ssh/id_rsa ; cat $HOME/.ssh/config

- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust || 'stable' }}
profile: minimal
components: llvm-tools-preview
override: true
components: llvm-tools-preview,llvm-cov

- name: Build debug
uses: actions-rs/cargo@v1
with:
command: build
args: ${{ matrix.build-args }}
run: cargo build ${{ matrix.build-args }}
env:
RUSTFLAGS: "-A dead_code"

Expand All @@ -111,34 +102,36 @@ jobs:

- name: Test
if: matrix.coverage
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.test-args }}
run: cargo test ${{ matrix.test-args }}
env:
CARGO_INCREMENTAL: "0"
# To debug the output when commands fail
TRYCMD: "dump"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
# RUSTFLAGS: "-Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
RUSTFLAGS: "-Cinstrument-coverage"
# RUSTDOCFLAGS: "-Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off"
# LLVM_PROFILE_FILE: "xvc-%p-%m.profraw"

- name: Install cargo-llvm-cov
if: matrix.coverage
uses: taiki-e/install-action@cargo-llvm-cov

- name: Coverage
id: coverage
if: matrix.coverage
uses: actions-rs/[email protected]
- name: Test all benches
if: matrix.benches
uses: actions-rs/cargo@v1
with:
command: test
args: --benches ${{ matrix.features }}
run: cargo llvm-cov --features ${{ matrix.features }} --workspace --lcov --output-path lcov.info

- name: Upload to codecov.io
if: matrix.coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ steps.coverage.outputs.report }}

- name: Test all benches
if: matrix.benches
run: cargo test --benches ${{ matrix.features }}

deploy-linux:
name: deploy-linux
# needs: [coverage]
Expand All @@ -147,31 +140,28 @@ jobs:
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]

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

- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target ${{ matrix.target }} --features=bundled-openssl
run: cargo build --release --target ${{ matrix.target }} --features=bundled-openssl

- name: Package
shell: bash
run: |
#strip target/${{ matrix.target }}/release/xvc
cd target/${{ matrix.target }}/release
tar czvf ../../../xvc-${{ github.ref_name}}-${{ matrix.target }}.tar.gz xvc
tar czvf ../../../xvc-${{ github.ref_name }}-${{ matrix.target }}.tar.gz xvc
cd -
- name: Publish
uses: softprops/action-gh-release@v1
# TODO: if any of the build step fails, the release should be deleted.
Expand All @@ -191,20 +181,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target ${{ matrix.target }} --features bundled-sqlite
run: cargo build --release --target ${{ matrix.target }} --features bundled-sqlite

- name: Package
shell: bash
Expand All @@ -213,13 +198,15 @@ jobs:
cd target/${{ matrix.target }}/release
tar czvf ../../../xvc-${{ github.ref_name}}-${{ matrix.target }}.tar.gz xvc
cd -
- name: Publish
uses: softprops/action-gh-release@v1
# TODO: if any of the build step fails, the release should be deleted.
with:
files: "xvc*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

deploy-macos:
name: deploy-macos
# needs: [coverage]
Expand All @@ -228,23 +215,19 @@ jobs:
strategy:
matrix:
target: [x86_64-apple-darwin]

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

- name: Install rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: false
command: build
args: --release --target ${{ matrix.target }}
run: cargo build --release --target ${{ matrix.target }}

- name: Package
shell: bash
Expand All @@ -253,6 +236,7 @@ jobs:
cd target/${{ matrix.target }}/release
tar czvf ../../../xvc-${{ github.ref_name}}-${{ matrix.target }}.tar.gz xvc
cd -
- name: Publish
uses: softprops/action-gh-release@v1
# TODO: if any of the build step fails, the release should be deleted.
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 0.6.12-alpha.1 (2024-11-28)

- PR: <https://github.com/iesahin/xvc/pull/261>
- Fixed cache permissions issue
- Add --include-git-files option to xvc file track and xvc file list commands
- Don't track and list Git-tracked files by default
Expand All @@ -11,6 +12,7 @@

## 0.6.11 (2024-09-04)

- PR: <https://github.com/iesahin/xvc/pull/260>
- Bump dependencies
- Replace globset with fast-glob for memory usage
- Remove --details option from xvc check-ignore
Expand Down

0 comments on commit 9862b3b

Please sign in to comment.