Skip to content

Commit

Permalink
feat: add .github/workflows/
Browse files Browse the repository at this point in the history
  • Loading branch information
nezutero committed Jan 16, 2024
1 parent 30fe3d1 commit c49a2f2
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Go Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 'latest'

- name: Run tests
run: go test ./...

- name: Check if tests passed
run: |
test_exit_code=$?
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed!"
else
echo "Tests failed!"
exit $test_exit_code
fi
32 changes: 32 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: github pages

on:
push:
branches:
- master # Set a branch that will trigger a deployment
pull_request:

jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 'latest'
extended: true

- name: Build
run: hugo --minify --gc --destination ../public --source ./exampleSite --themesDir ../.. --baseURL https://clente.github.io/hugo-bearcub/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
38 changes: 38 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Node.js Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Run tests
run: npm test

- name: Check if tests passed
run: |
test_exit_code=$?
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed!"
else
echo "Tests failed!"
exit $test_exit_code
fi
40 changes: 40 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Python Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: pytest

- name: Check if tests passed
run: |
test_exit_code=$?
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed!"
else
echo "Tests failed!"
exit $test_exit_code
fi
35 changes: 35 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Rust Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Rust
uses: actions/setup-rust@v1
with:
rust-version: 'stable'

- name: Run tests
run: cargo test

- name: Check if tests passed
run: |
test_exit_code=$?
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed!"
else
echo "Tests failed!"
exit $test_exit_code
fi

0 comments on commit c49a2f2

Please sign in to comment.