github actions: rewrite file test action to fix ulimit; add timeouts

This commit is contained in:
Joakim Frostegård 2021-10-23 19:02:05 +02:00
parent 08488f50cd
commit d0aa87f99e
5 changed files with 20 additions and 13 deletions

View file

@ -1,8 +1,10 @@
# Container image that runs your code # Not used by Github action, but can be used to run test locally:
# 1. docker build -t aquatic ./path/to/Dockerfile
# 2. docker run aquatic
# 3. On failure, run `docker rmi aquatic -f` and go back to step 1
FROM rust:bullseye FROM rust:bullseye
# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View file

@ -10,5 +10,7 @@ outputs:
wss_ipv4: wss_ipv4:
description: 'WSS IPv4 status' description: 'WSS IPv4 status'
runs: runs:
using: 'docker' using: 'composite'
image: 'Dockerfile' steps:
- run: $GITHUB_ACTION_PATH/entrypoint.sh
shell: bash

View file

@ -5,11 +5,6 @@
# #
# IPv6 is unfortunately disabled by default in Docker # IPv6 is unfortunately disabled by default in Docker
# (see sysctl net.ipv6.conf.lo.disable_ipv6) # (see sysctl net.ipv6.conf.lo.disable_ipv6)
#
# When testing locally, use:
# 1. docker build -t aquatic ./path/to/Dockerfile
# 2. docker run aquatic
# 3. On failure, run `docker rmi aquatic -f` and go back to step 1
set -e set -e
@ -21,6 +16,8 @@ else
SUDO="" SUDO=""
fi fi
ulimit -a
$SUDO apt-get update $SUDO apt-get update
$SUDO apt-get install -y cmake libssl-dev screen rtorrent mktorrent ssl-cert ca-certificates curl golang $SUDO apt-get install -y cmake libssl-dev screen rtorrent mktorrent ssl-cert ca-certificates curl golang
@ -43,6 +40,9 @@ else
cd "$GITHUB_WORKSPACE" cd "$GITHUB_WORKSPACE"
fi fi
echo "last aquatic commits:"
git log --oneline -3
# Setup bogus TLS certificate # Setup bogus TLS certificate
$SUDO echo "127.0.0.1 example.com" >> /etc/hosts $SUDO echo "127.0.0.1 example.com" >> /etc/hosts

View file

@ -11,9 +11,8 @@ env:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build - name: Build

View file

@ -10,9 +10,13 @@ jobs:
test-transfer-http: test-transfer-http:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: "Test BitTorrent file transfer over HTTP (with and without TLS), UDP and WSS" name: "Test BitTorrent file transfer over HTTP (with and without TLS), UDP and WSS"
timeout-minutes: 20
container:
image: rust:1-bullseye
options: --ulimit memlock=524288:524288
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Test file transfers - name: Test file transfers
uses: ./.github/actions/test-transfer uses: ./.github/actions/test-transfer
id: test_transfer id: test_transfer