Skip to content

Commit

Permalink
Merge pull request #2 from SciLifeLab/First_Draft
Browse files Browse the repository at this point in the history
Merge First_Draft branch to main
  • Loading branch information
Juho0 authored Aug 2, 2022
2 parents e593e4b + 32d6a95 commit d77ed68
Show file tree
Hide file tree
Showing 8 changed files with 1,293 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Clippy is a tool that runs a bunch of tests on the Rust code to catch common mistakes and discouraged patterns.

name: Analyze with Rust Clippy

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
rust-clippy-analyze:
name: Run rust-clippy analyzing
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
with:
profile: minimal
toolchain: stable
components: clippy
override: true

- name: Install required cargo
run: cargo install clippy-sarif sarif-fmt

- name: Run rust-clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
60 changes: 60 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish to Dockerhub

on:
push:
branches:
- main
- 'releases/**'
- AddCIpipelines
tags:
- 'v*' #if a push with a version tag like v0.0.2 is recorded

release:
types: [published]

jobs:
push_to_registry:
if: github.repository == 'SciLifeLab/umi-transfer'
name: Push Docker image to Docker Hub / GitHub Docker Registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Change repo name to lowercase
run: |
echo "REPO_LOWERCASE=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push dev image
uses: docker/build-push-action@v2
if: github.event_name == 'push'
with:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:dev
ghcr.io/${{ env.REPO_LOWERCASE }}:dev
- name: Push release image
uses: docker/build-push-action@v2
if: github.event_name == 'release'
with:
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:${{ github.event.release.tag_name }}
${{ secrets.DOCKERHUB_USERNAME }}/umi-transfer:latest
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.event.release.tag_name }}
ghcr.io/${{ env.REPO_LOWERCASE }}:${{ github.sha }}
ghcr.io/${{ env.REPO_LOWERCASE }}:latest
21 changes: 21 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test successful compilation on Rust

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
Loading

0 comments on commit d77ed68

Please sign in to comment.