Skip to content

Commit

Permalink
test(ci-rs.yml): Test with hello world echo for docker runner
Browse files Browse the repository at this point in the history
  • Loading branch information
miniben-90 committed Aug 6, 2024
1 parent cc31092 commit 3ecf9e4
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/ci-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ name: Build & Test & publich Rust package "x-win"

env:
APP_NAME: x-win
MACOSX_DEPLOYMENT_TARGET: '10.13'
MACOSX_DEPLOYMENT_TARGET: "10.13"

on:
push:
branches:
- main
tags-ignore:
- '**'
- "**"
paths-ignore:
- '**/*.md'
- "**/*.md"
- LICENSE
- '**/*.gitignore'
- "**/*.gitignore"
- .editorconfig
- docs/**
pull_request: null
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
# Build matrix for Windows (x32)
- host: windows-latest
target: i686-pc-windows-msvc
architecture: 'x86'
architecture: "x86"

# Build matrix for Windows (arm64)
- host: windows-latest
Expand All @@ -53,7 +53,7 @@ jobs:
# Build for linux (using Ubuntu) (x64)
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu

# Build for linux (using Ubuntu) (x64)
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
Expand Down Expand Up @@ -110,23 +110,14 @@ jobs:
- name: Test
if: ${{ matrix.settings.host != 'ubuntu-latest' }}
run: cargo test

- name: Test (x86_64-unknown-linux-gnu & x86_64-unknown-linux-musl)
if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' || matrix.settings.target == 'x86_64-unknown-linux-musl' }}
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.settings.image }}
options: --user 0:0 -v ${{ github.workspace }}/.github/docker-ubuntu-rust-install.sh:/usr/local/docker-ubuntu-rust-install.sh -v ${{ github.workspace }}/x-win-rs:/work -w /work
run: |
Xvfb :0 &
sleep 1
gpg-agent --daemon
sleep 1
xfce4-session &
sleep 1
sh /usr/local/docker-ubuntu-rust-install.sh ${{ matrix.settings.target }}
cd /work
cargo test --target ${{ matrix.settings.target }}
run: echo "hello world!"

- name: Build
run: cargo build --release --target ${{ matrix.settings.target }}
Expand Down Expand Up @@ -176,8 +167,8 @@ jobs:
toolchain: stable

# Update Cargo.toml version
- name: Set version to package.json
- name: Set version to package.json
run: node ${{ github.workspace }}/.scripts/before-publish.cjs x-win-rs

- name: Publish package
run: cargo publish
run: cargo publish

0 comments on commit 3ecf9e4

Please sign in to comment.