Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jan 31, 2024
1 parent 79dd834 commit 1e32f73
Showing 1 changed file with 5 additions and 128 deletions.
133 changes: 5 additions & 128 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
name: Build and Test

on:
pull_request:
push:
branches:
- main
- releases/*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: 20.x
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- run: npm run format-check
- run: npm run lint
- run: npm test
- name: Verify no unstaged changes
run: __test__/verify-no-unstaged-changes.sh

test:
strategy:
matrix:
Expand Down Expand Up @@ -95,6 +76,11 @@ jobs:
- name: Verify sparse checkout
run: __test__/verify-sparse-checkout.sh

- name: Verify not disabled sparse checkout
shell: bash
run: set -x && ! ls -l src/git-command-manager.ts

# Sparse checkout (non-cone mode)
# Disabled sparse checkout in existing checkout
- name: Disabled sparse checkout
uses: ./
Expand Down Expand Up @@ -181,112 +167,3 @@ jobs:
path: basic
- name: Verify basic
run: __test__/verify-basic.sh --archive

test-proxy:
runs-on: ubuntu-latest
container:
image: alpine/git:latest
options: --dns 127.0.0.1
services:
squid-proxy:
image: ubuntu/squid:latest
ports:
- 3128:3128
env:
https_proxy: http://squid-proxy:3128
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3

# Basic checkout using git
- name: Checkout basic
uses: ./
with:
ref: test-data/v2/basic
path: basic
- name: Verify basic
run: __test__/verify-basic.sh

# Basic checkout using REST API
- name: Remove basic
run: rm -rf basic
- name: Override git version
run: __test__/override-git-version.sh
- name: Basic checkout using REST API
uses: ./
with:
ref: test-data/v2/basic
path: basic
- name: Verify basic
run: __test__/verify-basic.sh --archive

test-bypass-proxy:
runs-on: ubuntu-latest
env:
https_proxy: http://no-such-proxy:3128
no_proxy: api.github.com,github.com
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3

# Basic checkout using git
- name: Checkout basic
uses: ./
with:
ref: test-data/v2/basic
path: basic
- name: Verify basic
run: __test__/verify-basic.sh
- name: Remove basic
run: rm -rf basic

# Basic checkout using REST API
- name: Override git version
run: __test__/override-git-version.sh
- name: Checkout basic using REST API
uses: ./
with:
ref: test-data/v2/basic
path: basic
- name: Verify basic
run: __test__/verify-basic.sh --archive

test-git-container:
runs-on: ubuntu-latest
container: bitnami/git:latest
steps:
# Clone this repo
- name: Checkout
uses: actions/checkout@v3
with:
path: v3

# Basic checkout using git
- name: Checkout basic
uses: ./v3
with:
ref: test-data/v2/basic
- name: Verify basic
run: |
if [ ! -f "./basic-file.txt" ]; then
echo "Expected basic file does not exist"
exit 1
fi
# Verify .git folder
if [ ! -d "./.git" ]; then
echo "Expected ./.git folder to exist"
exit 1
fi
# Verify auth token
git config --global --add safe.directory "*"
git fetch --no-tags --depth=1 origin +refs/heads/main:refs/remotes/origin/main
# needed to make checkout post cleanup succeed
- name: Fix Checkout v3
uses: actions/checkout@v3
with:
path: v3

0 comments on commit 1e32f73

Please sign in to comment.