diff --git a/.github/workflows/pull.yaml b/.github/workflows/pull.yaml new file mode 100644 index 0000000..8bdd50f --- /dev/null +++ b/.github/workflows/pull.yaml @@ -0,0 +1,21 @@ +name: PR to main + +on: + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.1" + - name: Run tests + run: | + cd practice/exercism + go test ./... diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..fd08ec9 --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,28 @@ +name: Push to main + +on: + push: + branches: + - main + +jobs: + format: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: "1.23.1" + - name: Format + run: | + cd practice/exercism + go fmt ./... + - name: Commit changes + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "format" || exit 0 + git push