Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a bunch more tests to workflows #132

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/distcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Distcheck

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Build libmarias3
run: |
autoreconf -fi
./configure --enable-debug=yes
- name: Test
run:
make distcheck
25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Docs

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev python3-sphinx
- name: Build libmarias3
run: |
autoreconf -fi
./configure
- name: Build Docs
run:
make html
30 changes: 30 additions & 0 deletions .github/workflows/scanbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Scanbuild test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
# Ubuntu latest scan-build has issues 2024-09. This is a documentated hack
# to run Fedora instead
runs-on: ubuntu-latest
container:
image: fedora:latest
env:
CC: clang

steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo dnf install -y libcurl-devel clang-analyzer autoconf automake libtool
- name: Build libmarias3
run: |
autoreconf -fi
./configure --enable-debug=yes
- name: Scanbuild
run:
scan-build --use-cc=clang --use-c++=clang++ --status-bugs make
53 changes: 53 additions & 0 deletions .github/workflows/usan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: USAN test

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest
services:
minio:
# fixme: let's not depend on external unofficial image
image: lazybit/minio
ports:
- 9000:9000
env:
MINIO_ROOT_USER: accesskey
MINIO_ROOT_PASSWORD: password
options: --name=minio --health-cmd "curl http://localhost:9000/minio/health/live"

env:
S3KEY: accesskey
S3SECRET: password
S3REGION: ""
S3BUCKET: s3-test
S3HOST: 127.0.0.1
S3PORT: 9000
S3USEHTTP: 1
CC: clang
CFLAGS: "-fsanitize=undefined -fsanitize=nullability"

steps:
- uses: actions/checkout@v4
- name: Create bucket
run: |
wget https://dl.min.io/client/mc/release/linux-amd64/mc
chmod +x ./mc
./mc alias set minio http://127.0.0.1:9000 accesskey password
./mc mb --ignore-existing minio/s3-test
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Build libmarias3
run: |
autoreconf -fi
./configure --enable-debug=yes
make
- name: Test
run:
make check
14 changes: 7 additions & 7 deletions src/sha256_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ int sha256_vector(size_t num_elem, const uint8_t *addr[], const size_t *len,

static inline void WPA_PUT_BE64(uint8_t *a, uint64_t val)
{
a[0] = val >> 56;
a[1] = val >> 48;
a[2] = val >> 40;
a[3] = val >> 32;
a[4] = val >> 24;
a[5] = val >> 16;
a[6] = val >> 8;
a[0] = (val >> 56) & 0xff;
a[1] = (val >> 48) & 0xff;
a[2] = (val >> 40) & 0xff;
a[3] = (val >> 32) & 0xff;
a[4] = (val >> 24) & 0xff;
a[5] = (val >> 16) & 0xff;
a[6] = (val >> 8) & 0xff;
a[7] = val & 0xff;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ int main(int argc, char *argv[])

res = ms3_delete(ms3, s3bucket, "test/moved.txt");
ASSERT_EQ_(res, 0, "Result: %u", res);
res = ms3_delete(ms3, s3bucket, "test/copied.txt");
res = ms3_delete(ms3, s3bucket, "test/copy_###_test.txt");
res = ms3_delete(ms3, s3bucket, "test/copied###.txt");
ms3_delete(ms3, s3bucket, "test/copied.txt");
ms3_delete(ms3, s3bucket, "test/copy_###_test.txt");
ms3_delete(ms3, s3bucket, "test/copied###.txt");

ms3_free(data);
ms3_deinit(ms3);
Expand Down