Skip to content

Commit 7d008f5

Browse files
committed
build: add gh action
1 parent a7046e7 commit 7d008f5

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Install
15+
run: |
16+
set -e
17+
18+
echo "Installing ..."
19+
sudo apt-get install -y jq
20+
wget https://github.com/tus/tusd/releases/download/v1.0.0/tusd_linux_amd64.tar.gz
21+
tar xzf tusd_linux_amd64.tar.gz
22+
23+
echo "Configuring ..."
24+
chmod +x ./tusc.sh && bash -n ./tusc.sh
25+
chmod +x ./tusd_linux_amd64/tusd
26+
touch ~/.tus.dbg
27+
28+
- name: Test
29+
run: |
30+
set -e
31+
32+
echo "Running tusd ..."
33+
./tusd_linux_amd64/tusd --upload-dir ~/.tusd-data --base-path /tus/ > /dev/null 2>&1 &
34+
35+
echo "Uploading ..."
36+
DEBUG=1 ./tusc.sh -H 0:1080 -f tusd_linux_amd64.tar.gz -a sha256 -b /tus/
37+
38+
echo "Downloading ..."
39+
URL=$(./tusc.sh -H 0:1080 -f tusd_linux_amd64.tar.gz -a sha256 -b /tus/ -L -C -S | cut -c 6-999)
40+
wget $URL -O tusd_linux_amd64.tar.gz1
41+
42+
echo "Validating ..."
43+
[[ "$(md5sum tusd_linux_amd64.tar.gz1)" == "$(md5sum tusd_linux_amd64.tar.gz)1" ]] || exit 1
44+
45+
echo "Cleaning up ..."
46+
cat ~/.tus.json | jq
47+
rm -rf ~/.tus.dbg ~/.tus.json

0 commit comments

Comments
 (0)