Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(workflows): Split up workflows and reuse test flow #5

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Main
on:
push:
branches:
- main

jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
upload_docs_ghp:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: Remove possible old documentation
run: rm -rf ./docs
- name: Create index html handling subdirectory
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=tankerkoenig\">" > target/doc/index.html
- name: Move doc files from target to pages directory
run: cp -r target/doc ./docs
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs
13 changes: 13 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR Analysis
on:
pull_request:
branches:
- main
- develop

jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
with:
build_test: false
40 changes: 9 additions & 31 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: CI
name: Test
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_call:
inputs:
build_test:
description: "Should the build test be executed?"
default: true
required: false
type: boolean

jobs:
clippy:
Expand Down Expand Up @@ -57,6 +56,7 @@ jobs:
with:
command: test
build_test:
if: inputs.build_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -68,25 +68,3 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
upload_docs_ghp:
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
needs: [build_test, test, format, clippy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps
- name: Remove possible old documentation
run: rm -rf ./docs
- name: Create index html handling subdirectory
run: echo "<meta http-equiv=\"refresh\" content=\"0; url=tankerkoenig\">" > target/doc/index.html
- name: Move doc files from target do pages directory
run: cp -r target/doc ./docs
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs