mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-20 10:59:30 +08:00
Add PR checks (#1879)
* Add PR checks * Update PR workflow * Update PR workflow * Update PR workflow * Add branch name check + doc check * Update PR branch check * Update PR branch check * Update PR branch check
This commit is contained in:
parent
8bbbb0f148
commit
48b3fb0f51
23
.github/workflows/check_docs.yml
vendored
Normal file
23
.github/workflows/check_docs.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: Check Docs
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ 'feature/*' ]
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: Website Updated
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Verify Changed files
|
||||
uses: tj-actions/verify-changed-files@v11.1
|
||||
id: verify-changed-files
|
||||
with:
|
||||
files: |
|
||||
v2/website/*.mdx
|
||||
|
||||
- name: Run step only when files change.
|
||||
if: steps.verify-changed-files.outputs.files_changed != 'true'
|
||||
run: |
|
||||
echo "Feature branch does not contain any changes to the website."
|
40
.github/workflows/pr.yml
vendored
Normal file
40
.github/workflows/pr.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
name: PR Checks
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check_branch_name:
|
||||
runs-on: ubuntu-latest
|
||||
name: Check branch name
|
||||
steps:
|
||||
- run: |
|
||||
if ! [[ "$(echo ${GITHUB_HEAD_REF} | cut -d "/" -f1)" =~ (feature|bugfix|release|chore) ]]; then
|
||||
echo "PRs are only accepted for branches starting with: feature/, bugfix/, chore/ or release/"
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
test:
|
||||
name: Run Go Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: check_branch_name
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
||||
go-version: [ 1.18, 1.19 ]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install linux dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev build-essential pkg-config
|
||||
|
||||
- name: Set up Go 1.18
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Run tests
|
||||
run: go test -v ./...
|
Loading…
Reference in New Issue
Block a user