diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml new file mode 100644 index 000000000..6433f7073 --- /dev/null +++ b/.github/workflows/check_docs.yml @@ -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." diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..94691c804 --- /dev/null +++ b/.github/workflows/pr.yml @@ -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 ./...