Skip to content

Commit 8ed66dc

Browse files
author
Ankit Saini
authored
Add Github actions support (#662)
* Add Github actions support * Use libcurl4 instead of libcurl3 * Run npm install before deepinstall * Use .NET 6 framework for testing csharp-restsharp codegen * Install libcurl4-gnutls-dev during CI setup * Enable testing for Swift * Remove Travis integration * Add names to each step in the pipeline
1 parent 941d334 commit 8ed66dc

File tree

4 files changed

+35
-30
lines changed

4 files changed

+35
-30
lines changed

.github/workflows/integration.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
3+
on: push
4+
5+
jobs:
6+
Unit-Tests:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Get Code
10+
uses: actions/checkout@v3
11+
- name: Setup Node JS
12+
uses: actions/setup-node@v1
13+
with:
14+
node-version: '8.x'
15+
- name: Install system dependencies
16+
run: npm run cirequirements
17+
- name: Install package dependencies
18+
run: npm install
19+
- name: Install dependencies for individual codegens
20+
run: npm run deepinstall dev
21+
- name: Run tests
22+
run: npm run test

.travis.yml

-10
This file was deleted.

codegens/swift/test/newman/newman.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
var runNewmanTest = require('../../../../test/codegen/newman/newmanTestUtil').runNewmanTest,
22
convert = require('../../lib/index').convert;
33

4-
describe.skip('Convert for different types of request', function () {
4+
describe('Convert for different types of request', function () {
55
var options = {
66
indentType: 'Space',
77
indentCount: 4
88
},
99
// if running locally on mac change the runScript to 'swift snippet.swift'
1010
testConfig = {
1111
fileName: 'snippet.swift',
12-
runScript: 'swift-5.3-RELEASE-ubuntu16.04/usr/bin/swift snippet.swift',
12+
runScript: 'swift-5.7.3-RELEASE-ubuntu20.04/usr/bin/swift snippet.swift',
1313
skipCollections: ['sameNameHeadersCollection', 'unsupportedMethods']
1414
};
1515
runNewmanTest(convert, options, testConfig);

npm/ci-requirements.sh

+11-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -ev; # stop on error
33

4+
echo "Insalling dependencies required for tests in codegens/libcurl"
5+
sudo apt-get install libcurl4-gnutls-dev
6+
47
echo "Installing dependencies required for tests in codegens/java-okhttp"
58
pushd ./codegens/java-okhttp &>/dev/null;
69
sudo add-apt-repository ppa:openjdk-r/ppa -y
@@ -17,12 +20,12 @@ popd &>/dev/null;
1720

1821
echo "Installing dependencies required for tests in codegens/csharp-restsharp"
1922
pushd ./codegens/csharp-restsharp &>/dev/null;
20-
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
23+
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
2124
sudo dpkg -i packages-microsoft-prod.deb
2225
sudo apt-get install apt-transport-https
2326
sudo apt-get update
2427
sudo apt-get install dotnet-sdk-6.0
25-
dotnet new console -o testProject
28+
dotnet new console -o testProject -f net6.0
2629
pushd ./testProject &>/dev/null;
2730
dotnet add package RestSharp
2831
popd &>/dev/null;
@@ -39,27 +42,17 @@ echo "Installing dependencies required for tests in codegens/swift"
3942
pushd ./codegens/swift &>/dev/null;
4043
sudo apt-get update
4144
sudo apt-get install clang-3.6 libicu-dev libpython2.7 -y
42-
sudo apt-get install libcurl3 libpython2.7-dev -y
43-
sudo wget https://swift.org/builds/swift-5.3-release/ubuntu1604/swift-5.3-RELEASE/swift-5.3-RELEASE-ubuntu16.04.tar.gz
44-
sudo tar xzf swift-5.3-RELEASE-ubuntu16.04.tar.gz
45-
sudo chmod 777 swift-5.3-RELEASE-ubuntu16.04/usr/lib/swift/CoreFoundation/module.map
45+
sudo apt-get install libcurl4 libpython2.7-dev -y
46+
sudo wget https://download.swift.org/swift-5.7.3-release/ubuntu2004/swift-5.7.3-RELEASE/swift-5.7.3-RELEASE-ubuntu20.04.tar.gz
47+
sudo tar xzf swift-5.7.3-RELEASE-ubuntu20.04.tar.gz
48+
sudo chmod 777 swift-5.7.3-RELEASE-ubuntu20.04/usr/lib/swift/CoreFoundation/module.map
4649
popd &>/dev/null;
4750

4851
echo "Installing dependencies required for tests in codegens/csharp-restsharp"
4952
sudo apt-get install -y mono-complete
5053

51-
echo "Installing curl v7.68"
52-
sudo apt-get install -y libssl-dev autoconf libtool make
53-
wget https://curl.haxx.se/download/curl-7.68.0.zip
54-
unzip curl-7.68.0.zip
55-
pushd ./curl-7.68.0 &>/dev/null
56-
./buildconf
57-
./configure --with-ssl
58-
make
59-
sudo make install
60-
sudo cp /usr/local/bin/curl /usr/bin/curl
61-
sudo ldconfig
62-
popd &>/dev/null
54+
echo "Installing curl"
55+
sudo apt-get install -y curl
6356

6457
echo "Installing dependencies required for tests in codegens/shell-httpie"
6558
sudo apt-get install httpie

0 commit comments

Comments
 (0)