Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from approvers/ci
Browse files Browse the repository at this point in the history
Setup CI workflows
  • Loading branch information
siketyan authored Jul 3, 2020
2 parents 5ebde89 + 937b066 commit b706afb
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker

on:
push:
branches:
- master

tags:
- v*

env:
IMAGE_NAME: members-db-rust

jobs:
push:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build an image with a tag
run: docker build -t app .

- name: Log into the registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin

- name: Push the image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=latest
docker tag app $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
52 changes: 52 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Rust

on:
- push

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt,clippy

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose

- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose

0 comments on commit b706afb

Please sign in to comment.