Skip to content

Commit

Permalink
Add a bunch more tests to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxJedi committed Sep 27, 2024
1 parent 97bfb11 commit 3386bae
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 11 deletions.
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
27 changes: 27 additions & 0 deletions .github/workflows/scanbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Scanbuild test

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

jobs:
build:
runs-on: ubuntu-latest
env:
CC: clang

steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev clang-tools
- 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
16 changes: 8 additions & 8 deletions src/sha256_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ 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[7] = val & 0xff;
a[0] = (uint8_t) ((uint64_t)val >> 56);
a[1] = (uint8_t) ((uint64_t)val >> 48);
a[2] = (uint8_t) ((uint64_t)val >> 40);
a[3] = (uint8_t) ((uint64_t)val >> 32);
a[4] = (uint8_t) ((uint64_t)val >> 24);
a[5] = (uint8_t) ((uint64_t)val >> 16);
a[6] = (uint8_t) ((uint64_t)val >> 8);
a[7] = (uint8_t) ((uint64_t)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

0 comments on commit 3386bae

Please sign in to comment.