Skip to content

Commit

Permalink
Merge pull request #512 from dedis/drandmerge
Browse files Browse the repository at this point in the history
Final merge PR for drand/kyber
  • Loading branch information
pierluca committed Jul 15, 2024
2 parents fc615d5 + 4fba34d commit d1b0370
Show file tree
Hide file tree
Showing 264 changed files with 55,432 additions and 3,794 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Deploy Static Site and React App to GitHub Pages

on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies and build React app
run: |
cd ./docs/benchmark-app/
npm install
npm run build
cd ../../
mkdir -p public/benchmark
mv ./docs/benchmark-app/build/* public/benchmark/
- name: Copy static index.html
run: |
cp ./docs/index.html public/
cp ./docs/*.md public/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
32 changes: 0 additions & 32 deletions .github/workflows/go_lint.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Lint
on:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.20'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.56.2

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
59 changes: 0 additions & 59 deletions .github/workflows/test_on_push.yml

This file was deleted.

78 changes: 60 additions & 18 deletions .github/workflows/test_on_pr.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Test on PR
name: Go Tests

on:
pull_request_target:
types: [opened, synchronize, reopened, labeled]
push:
branches: [ master ]

concurrency:
group: ci-${{ github.ref }}-test
cancel-in-progress: true

jobs:
permission:
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{matrix.platform}}
if: ${{ github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
steps:
- name: Add comment if PR permission failed
if: ${{ !contains(github.event.pull_request.labels.*.name, 'safe PR') }}
Expand All @@ -28,38 +32,71 @@ jobs:
run: |
echo "::error:: Could not start CI tests due to missing *safe PR* label."
exit 1
test:
needs: permission
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe PR')) }}
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{matrix.platform}}
os: [windows-latest, ubuntu-latest, macos-latest]
size: ['64b', '32b']
golang: ['1.21.10', '1.22.3']
exclude:
- os: windows-latest
size: '32b'
- os: macos-latest
size: '32b'

runs-on: ${{ matrix.os }}
env:
DBGSYNCLOG: trace
DBGSYNCON: true

steps:
- name: Set up Go ^1.13
uses: actions/setup-go@v3
- name: Set up Go ${{ matrix.golang }}
uses: actions/setup-go@v5
if: ${{ matrix.size == '64b' }}
with:
go-version: ^1.13
go-version: ${{ matrix.golang }}
check-latest: false

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Test without coverage
if: matrix.platform == 'macos-latest' || matrix.platform == 'windows-latest'
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
if: ${{ matrix.size == '32b' }}
with:
arch: x86
packages: >
make
git
gcc
musl-dev
- name: Test without coverage (Windows, MacOS)
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'windows-latest' }}
run: make test

- name: Test without coverage (Ubuntu x86)
if: ${{ matrix.size == '32b' }}
run: |
cd ..
wget -O go.tgz -nv https://go.dev/dl/go${{matrix.golang}}.linux-386.tar.gz
tar -xzf go.tgz
export PATH=$PATH:$(pwd)/go/bin
cd kyber
make test
shell: alpine.sh {0}

- name: Test with coverage
if: matrix.platform == 'ubuntu-latest'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.size == '64b' }}
run: make coverage

- name: SonarCloud scan
if: matrix.platform == 'ubuntu-latest'
if: ${{ matrix.os == 'ubuntu-latest' && matrix.size == '64b' }}
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -76,4 +113,9 @@ jobs:
-Dsonar.c.file.suffixes=-
-Dsonar.cpp.file.suffixes=-
-Dsonar.objc.file.suffixes=-
- name: Send coverage
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.size == '64b' }}
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ exit_tunnel
.DS_Store
*.cov
profile.tmp
Coding/
Coding/
.idea/
Loading

0 comments on commit d1b0370

Please sign in to comment.