2024-10-08 21:22:00 +00:00
|
|
|
# MIT License
|
|
|
|
#
|
|
|
|
# Copyright (c) 2024 vinchent <vinchent@vinchent.xyz>
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in all
|
|
|
|
# copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
# SOFTWARE.
|
|
|
|
|
|
|
|
name: Build and test
|
|
|
|
run-name: ${{ gitea.actor }} is building and testing the project!
|
2024-10-08 19:22:18 +00:00
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2024-10-08 21:22:00 +00:00
|
|
|
Build:
|
2024-10-08 19:22:18 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
|
|
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
|
|
|
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
|
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
|
|
|
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
|
|
|
- name: List files in the repository
|
|
|
|
run: |
|
|
|
|
ls ${{ gitea.workspace }}
|
2024-10-08 21:22:00 +00:00
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: '1.23.1'
|
|
|
|
- run: go version
|
|
|
|
- name: Setup sqlc
|
|
|
|
uses: sqlc-dev/setup-sqlc@v4
|
|
|
|
with:
|
|
|
|
sqlc-version: '1.25.0'
|
|
|
|
- run: sqlc version
|
|
|
|
- name: Build backend
|
|
|
|
run: make build
|
|
|
|
- name: Test backend
|
|
|
|
run: make test
|
2024-10-08 21:28:00 +00:00
|
|
|
- name: Setup node
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- name: Build frontend
|
|
|
|
run: make web-build
|
|
|
|
- name: Test frontend
|
|
|
|
run: make web-test
|
2024-10-08 19:22:18 +00:00
|
|
|
- run: echo "🍏 This job's status is ${{ job.status }}."
|