Add github actions

This commit is contained in:
Didactic Drunk 2021-06-01 01:49:19 -07:00
parent 4da95b6398
commit 7bbb393ef5
3 changed files with 68 additions and 1 deletions

33
.github/workflows/crystal.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Crystal CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: crystallang/crystal
steps:
- uses: actions/checkout@v2
- name: Install wget
run: sudo apt-get install wget
- name: setenv DEBUG
run: echo "SODIUM_BUILD_DEBUG=1" >> $GITHUB_ENV
- name: setenv BUILD_DIR
run: echo "LIBSODIUM_BUILD_DIR=$HOME/libsodium" >> $GITHUB_ENV
- name: Install dependencies
run: shards install
- name: Run tests
run: crystal spec -Dpreview_mt --order random --error-on-warnings
- name: Run bulid
run: shards build -Dpreview_mt
- name: Run format
run: crystal tool format --check

35
.github/workflows/deploy_docs.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Deploy Docs
on:
push:
branches:
- master
tags:
- v*
paths-ignore:
- "CHANGELOG.md"
jobs:
deploy:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- uses: MeilCli/setup-crystal-action@v4.0.1
with:
crystal_version: 1.0.0
shards_version: 0.14.1
- name: Install dependencies
run: shards install
- name: Run crystal doc
run: crystal doc
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3.7.0-8
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
destination_dir: ${{ steps.extract_branch.outputs.branch }}

View File

@ -61,7 +61,6 @@ Crystal bindings for the [libsodium API](https://libsodium.gitbook.io/doc/)
- [x] Fast. Benchmarks available in `benchmarks`. - [x] Fast. Benchmarks available in `benchmarks`.
- [x] [Most classes are safe to share between threads.](THREAD_SAFETY.md) - [x] [Most classes are safe to share between threads.](THREAD_SAFETY.md)
- [x] Tested with real crystal threads and will continue to work when crystal officially supports threading. - [x] Tested with real crystal threads and will continue to work when crystal officially supports threading.
- [x] Most classes are safe to share between threads. Even
- [ ] Controlled memory wiping (by calling `.close`) - [ ] Controlled memory wiping (by calling `.close`)
☑ Indicate specs are compared against test vectors from another source. ☑ Indicate specs are compared against test vectors from another source.