diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..66a2886 --- /dev/null +++ b/.github/workflows/go.yml @@ -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 diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml new file mode 100644 index 0000000..9ca5a38 --- /dev/null +++ b/.github/workflows/hugo.yml @@ -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 diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..c23bba1 --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -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 diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..bdb405c --- /dev/null +++ b/.github/workflows/python.yml @@ -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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..81c1eef --- /dev/null +++ b/.github/workflows/rust.yml @@ -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