mirror of
https://github.com/mCaptcha/cache.git
synced 2026-01-25 04:16:29 +00:00
87 lines
2.5 KiB
YAML
87 lines
2.5 KiB
YAML
name: CI (Linux)
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 9 * * *"
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
push:
|
|
branches:
|
|
- master
|
|
- "*"
|
|
- "!gh-pages"
|
|
|
|
jobs:
|
|
build_and_test:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
version:
|
|
- stable
|
|
- nightly
|
|
|
|
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: ⚡ Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
/var/lib/docker
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: configure GPG key
|
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
|
run: echo -n "$RELEASE_BOT_GPG_SIGNING_KEY" | gpg --batch --import --pinentry-mode loopback
|
|
env:
|
|
RELEASE_BOT_GPG_SIGNING_KEY: ${{ secrets.RELEASE_BOT_GPG_SIGNING_KEY }}
|
|
|
|
- name: Install ${{ matrix.version }}
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
|
profile: minimal
|
|
override: false
|
|
|
|
- name: install virtualenv
|
|
run: pip install virtualenv
|
|
|
|
- name: install dependencies
|
|
run: make env
|
|
|
|
- name: build docker image
|
|
run: make docker-build
|
|
|
|
- name: start docker container
|
|
run: make docker-run
|
|
|
|
- name: run tests
|
|
run: make test
|
|
|
|
- name: stop docker container
|
|
run: make docker-stop
|
|
|
|
- name: Login to DockerHub
|
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: mcaptcha
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: build and publish docker images
|
|
if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
|
run: make docker
|
|
|
|
# TODO: key expired, regenerate and re-enable
|
|
# - name: publish bins
|
|
# if: (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'mCaptcha/cache'
|
|
# run: ./scripts/publish.sh publish master latest $DUMBSERVE_PASSWORD
|
|
# env:
|
|
# DUMBSERVE_PASSWORD: ${{ secrets.DUMBSERVE_PASSWORD }}
|
|
# GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
|