forked from Schniz/fnm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate e2e tests to nodejs (Schniz#849)
resolves Schniz#848
- Loading branch information
Showing
166 changed files
with
4,361 additions
and
2,868 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,10 @@ on: | |
branches: | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
|
@@ -41,27 +45,7 @@ jobs: | |
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: cargo test -- --skip=feature_tests | ||
|
||
e2e_tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
steps: | ||
- name: Install Fish and Zsh using brew | ||
if: "startsWith(matrix.os, 'macOS')" | ||
run: brew install fish zsh | ||
- name: Install Fish and Zsh using apt | ||
if: "startsWith(matrix.os, 'ubuntu')" | ||
run: sudo apt-get install -y fish zsh | ||
- uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
- uses: Swatinem/rust-cache@v1 | ||
- uses: actions/checkout@v3 | ||
- name: Run tests | ||
run: cargo test -- feature_tests | ||
run: cargo test | ||
|
||
build_release: | ||
runs-on: windows-latest | ||
|
@@ -103,6 +87,116 @@ jobs: | |
name: fnm-macos | ||
path: target/release/fnm | ||
|
||
e2e_macos: | ||
runs-on: macos-latest | ||
needs: [build_macos_release] | ||
name: "e2e/macos" | ||
steps: | ||
- name: install necessary shells | ||
run: brew install fish zsh bash | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: fnm-macos | ||
path: target/release | ||
- name: mark binary as executable | ||
run: chmod +x target/release/fnm | ||
- uses: pnpm/[email protected] | ||
with: | ||
run_install: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'pnpm' | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- run: pnpm install | ||
- run: pnpm test | ||
env: | ||
FNM_TARGET_NAME: "release" | ||
FORCE_COLOR: "1" | ||
|
||
e2e_windows: | ||
runs-on: windows-latest | ||
needs: [build_release] | ||
name: "e2e/windows" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: fnm-windows | ||
path: target/release | ||
- uses: pnpm/[email protected] | ||
with: | ||
run_install: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'pnpm' | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- run: pnpm install | ||
- run: pnpm test | ||
env: | ||
FNM_TARGET_NAME: "release" | ||
FORCE_COLOR: "1" | ||
|
||
e2e_linux: | ||
runs-on: ubuntu-latest | ||
needs: [build_static_linux_binary] | ||
name: "e2e/linux" | ||
steps: | ||
- name: install necessary shells | ||
run: sudo apt-get update && sudo apt-get install -y fish zsh bash | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: fnm-linux | ||
path: target/release | ||
- name: mark binary as executable | ||
run: chmod +x target/release/fnm | ||
- uses: pnpm/[email protected] | ||
with: | ||
run_install: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'pnpm' | ||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- run: pnpm install | ||
- run: pnpm test | ||
env: | ||
FNM_TARGET_NAME: "release" | ||
FORCE_COLOR: "1" | ||
|
||
build_static_linux_binary: | ||
name: "Build static Linux binary" | ||
runs-on: ubuntu-latest | ||
|
Oops, something went wrong.