Skip to content

Commit ac2ddc3

Browse files
committed
chore: Add individual run for each language
1 parent 379c58e commit ac2ddc3

File tree

21 files changed

+229
-148
lines changed

21 files changed

+229
-148
lines changed

.github/workflows/test.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,23 @@ jobs:
1313
strategy:
1414
matrix:
1515
node-version: [ 18.x, 20.x ]
16+
language-variant: [ 'csharp-httpclient', 'csharp-restsharp', 'curl', 'dart-dio', 'dart-http', 'golang', 'http',
17+
'java-okhttp', 'java-unirest', 'js-fetch', 'js-jquery', 'js-xhr', 'kotlin-okhttp', 'libcurl',
18+
'nodejs-axios', 'nodejs-native', 'nodejs-request', 'nodejs-unirest', 'objective-c', 'ocaml-cohttp',
19+
'php-curl', 'php-guzzle', 'php-httprequest2', 'php-pecl-http', 'powershell-restmethod',
20+
'python-http.client', 'python-requests', 'r-httr', 'r-rcurl', 'ruby', 'rust-reqwest',
21+
'shell-httpie', 'shell-wget', 'swift' ]
1622
steps:
1723
- name: Get Code
1824
uses: actions/checkout@v3
1925
- name: Use Node JS ${{ matrix.node-version }}
2026
uses: actions/setup-node@v1
2127
with:
2228
node-version: ${{ matrix.node-version }}
23-
- name: Install system dependencies
24-
run: npm run cirequirements
2529
- name: Install package dependencies
2630
run: npm install
31+
- name: Install system dependencies
32+
run: npm run cirequirements ${{ matrix.language-variant }}
2733
- name: Install dependencies for individual codegens
2834
run: npm run deepinstall dev
2935
- name: Run tests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
sudo apt-get update
5+
echo "Installing dependencies required for tests in codegens/csharp-httpclient"
6+
# Install latest .net6.0 sdk
7+
pushd ./codegens/csharp-httpclient &>/dev/null;
8+
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
9+
sudo dpkg -i packages-microsoft-prod.deb
10+
sudo apt-get install apt-transport-https
11+
sudo apt-get update
12+
sudo apt-get install dotnet-sdk-6.0
13+
dotnet new console -o testProject -f net6.0
14+
# no extra packages needed
15+
popd &>/dev/null;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
sudo apt-get update
5+
echo "Installing dependencies required for tests in codegens/csharp-restsharp"
6+
pushd ./codegens/csharp-restsharp &>/dev/null;
7+
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
8+
sudo dpkg -i packages-microsoft-prod.deb
9+
sudo apt-get install apt-transport-https
10+
sudo apt-get update
11+
sudo apt-get install dotnet-sdk-6.0
12+
dotnet new console -o testProject -f net6.0
13+
pushd ./testProject &>/dev/null;
14+
dotnet add package RestSharp --version 112.0.0
15+
popd &>/dev/null;
16+
popd &>/dev/null;
17+
18+
sudo apt-get install -y mono-complete

codegens/curl/test/ci-install.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing curl"
5+
sudo apt-get install -y curl

codegens/dart-dio/test/ci-install.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/dart-dio"
5+
pushd ./codegens/dart-dio &>/dev/null;
6+
wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/3.0.4/linux_packages/dart_3.0.4-1_amd64.deb
7+
sudo dpkg -i dart_3.0.4-1_amd64.deb
8+
echo '''name: test
9+
version: 1.0.0
10+
environment:
11+
sdk: ^3.0.3
12+
dependencies:
13+
dio: ^5.2.0
14+
''' > pubspec.yaml
15+
dart pub get
16+
popd &>/dev/null;

codegens/dart-http/test/ci-install.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/dart-http"
5+
pushd ./codegens/dart-http &>/dev/null;
6+
wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/3.0.4/linux_packages/dart_3.0.4-1_amd64.deb
7+
sudo dpkg -i dart_3.0.4-1_amd64.deb
8+
echo '''name: test
9+
version: 1.0.0
10+
environment:
11+
sdk: ^3.0.3
12+
dependencies:
13+
http: ^1.0.0
14+
''' > pubspec.yaml
15+
dart pub get
16+
popd &>/dev/null;
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/java-okhttp"
5+
pushd ./codegens/java-okhttp &>/dev/null;
6+
sudo add-apt-repository ppa:openjdk-r/ppa -y
7+
sudo rm -rf /var/lib/apt/lists/*
8+
sudo apt-get update
9+
sudo apt-get install -y openjdk-8-jdk
10+
unzip test/unit/fixtures/dependencies.zip
11+
popd &>/dev/null;
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/java-unirest"
5+
pushd ./codegens/java-unirest &>/dev/null;
6+
unzip test/unit/fixtures/dependencies.zip
7+
popd &>/dev/null;
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/kotlin-okhttp"
5+
pushd ./codegens/kotlin-okhttp &>/dev/null;
6+
sudo add-apt-repository ppa:openjdk-r/ppa -y
7+
sudo rm -rf /var/lib/apt/lists/*
8+
sudo apt-get update
9+
sudo apt-get install -y openjdk-8-jdk
10+
sudo snap install --classic kotlin
11+
unzip test/unit/fixtures/dependencies.zip
12+
popd &>/dev/null;

codegens/libcurl/test/ci-install.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
sudo apt-get update
5+
6+
echo "Installing dependencies required for tests in codegens/libcurl"
7+
sudo apt-get install libcurl4-gnutls-dev
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/php-guzzle"
5+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
6+
php composer-setup.php
7+
php -r "unlink('composer-setup.php');"
8+
sudo mv composer.phar /usr/bin/composer
9+
composer global require guzzlehttp/guzzle:7.4.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/php-httprequest2"
5+
pear install HTTP_Request2-2.3.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing Powershell"
5+
sudo apt-get install powershell -y

codegens/r-httr/test/ci-install.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/r-httr"
5+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
6+
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
7+
sudo apt-get update
8+
sudo apt-get install r-base
9+
sudo R --vanilla -e 'install.packages("httr", version="1.4.2", repos="http://cran.us.r-project.org")'

codegens/r-rcurl/test/ci-install.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/r-httr"
5+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
6+
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
7+
sudo apt-get update
8+
sudo apt-get install r-base
9+
sudo R --vanilla -e 'install.packages("RCurl", version="1.98.1.6", repos="http://cran.us.r-project.org")'
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing Rust"
5+
sudo apt-get install -y build-essential pkg-config libssl-dev
6+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
7+
pushd ./codegens/rust-reqwest &>/dev/null;
8+
echo '''[package]
9+
name = "rust_reqwest_codegen"
10+
version = "0.0.1"
11+
edition = "2021"
12+
13+
[dependencies]
14+
reqwest = { version = "0.11.14", features = ["json", "multipart"] }
15+
tokio = { version = "1.26.0", features = ["full"] }
16+
serde_json = { version = "1.0.94" }''' > Cargo.toml
17+
mkdir src && echo '''fn main() {
18+
println!("Hello, world!");
19+
}''' > src/main.rs
20+
cargo build
21+
popd &>/dev/null;
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/shell-httpie"
5+
sudo apt-get install httpie

codegens/swift/test/ci-install.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -ev; # stop on error
3+
4+
echo "Installing dependencies required for tests in codegens/swift"
5+
pushd ./codegens/swift &>/dev/null;
6+
sudo apt-get update
7+
sudo apt-get install clang-3.6 libicu-dev libpython2.7 -y
8+
sudo apt-get install libcurl4 libpython2.7-dev -y
9+
sudo wget -q https://download.swift.org/swift-5.7.3-release/ubuntu2004/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu20.04.tar.gz
10+
sudo tar xzf swift-5.7.3-RELEASE-ubuntu20.04.tar.gz
11+
sudo chmod 777 swift-5.7.3-RELEASE-ubuntu20.04/usr/lib/swift/CoreFoundation/module.map
12+
popd &>/dev/null;

npm/ci-requirements.sh

-145
This file was deleted.

0 commit comments

Comments
 (0)