Skip to content

Commit

Permalink
migrate e2e tests to nodejs (Schniz#849)
Browse files Browse the repository at this point in the history
resolves Schniz#848
  • Loading branch information
Schniz authored Nov 16, 2022
1 parent b54be01 commit bedb955
Show file tree
Hide file tree
Showing 166 changed files with 4,361 additions and 2,868 deletions.
136 changes: 115 additions & 21 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- master

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
fmt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit bedb955

Please sign in to comment.