Skip to content

Commit 9c32e70

Browse files
committed
Create pipeline to lint and test
Closes: #29 Signed-off-by: Arthur Diniz <[email protected]>
1 parent b5777a4 commit 9c32e70

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed

.github/workflows/test.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# wcurl - a simple wrapper around curl to easily download files.
2+
#
3+
# This is wcurl's test pipeline.
4+
#
5+
# Copyright (C) Samuel Henrique <[email protected]>, Sergio Durigan
6+
# Junior <[email protected]> and many contributors, see the AUTHORS
7+
# file.
8+
#
9+
# Permission to use, copy, modify, and distribute this software for any purpose
10+
# with or without fee is hereby granted, provided that the above copyright
11+
# notice and this permission notice appear in all copies.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
16+
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
# OR OTHER DEALINGS IN THE SOFTWARE.
20+
#
21+
# Except as contained in this notice, the name of a copyright holder shall not be
22+
# used in advertising or otherwise to promote the sale, use or other dealings in
23+
# this Software without prior written authorization of the copyright holder.
24+
#
25+
# SPDX-License-Identifier: curl
26+
---
27+
name: Test
28+
29+
on:
30+
push:
31+
branches:
32+
- main
33+
pull_request:
34+
branches:
35+
- main
36+
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
lint:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Install tools
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y shellcheck devscripts
52+
53+
- name: Run shellcheck
54+
run: shellcheck wcurl tests/*
55+
56+
- name: Run checkbashisms
57+
run: checkbashisms wcurl tests/*
58+
59+
debian:
60+
name: debian
61+
runs-on: ubuntu-latest
62+
container:
63+
image: debian:stable
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v4
67+
68+
- name: Install curl and shunit2
69+
run: |
70+
apt-get update
71+
apt-get install -y curl shunit2
72+
73+
- name: Run shunit2 tests
74+
run: ./tests/tests.sh
75+
76+
fedora:
77+
name: fedora
78+
runs-on: ubuntu-latest
79+
container:
80+
image: fedora:latest
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v4
84+
85+
- name: Install git and shunit2
86+
run: |
87+
dnf install -y git
88+
git clone \
89+
--depth 1 --branch v2.1.8 \
90+
https://github.com/kward/shunit2.git
91+
cd shunit2
92+
cp shunit2 /usr/local/bin/shunit2
93+
94+
- name: Run shunit2 tests
95+
run: ./tests/tests.sh
96+
97+
macos:
98+
name: macos
99+
runs-on: macos-latest
100+
steps:
101+
- name: Checkout repository
102+
uses: actions/checkout@v4
103+
104+
- name: Install shunit2
105+
run: brew install shunit2
106+
107+
- name: Run shunit2 tests
108+
run: ./tests/tests.sh

0 commit comments

Comments
 (0)