diff --git a/.github/workflows/build.yml b/.github/workflows/build-and-release.yml similarity index 87% rename from .github/workflows/build.yml rename to .github/workflows/build-and-release.yml index 2a379f53..e576a534 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-and-release.yml @@ -1,11 +1,12 @@ # This workflow will: build gomud for multiple os/architectures # archive the binaries and create a new release for users to easily download -name: Go +name: Build and release on: push: - branches: ["master", "ci-cd-releases"] + branches: [master] + workflow_dispatch: permissions: contents: write @@ -14,14 +15,22 @@ env: RELEASE_FILENAME: go-mud-release jobs: - # test: - # runs-on: ubuntu-latest - # steps: - # - name: Test - # run: go test -v ./... + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Run tests + run: go test ./... build: runs-on: ubuntu-latest + needs: "test" steps: - uses: actions/checkout@v4 @@ -59,7 +68,7 @@ jobs: release: runs-on: ubuntu-latest - needs: build + needs: "build" steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..0f939c8f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,20 @@ +name: run-tests + +on: + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.23" + + - name: Run tests + run: go test ./... diff --git a/.gitignore b/.gitignore index 9e7ebc2c..53ec530a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .vscode private-notes.txt **/users/* -**/config-overrides.yaml -bin/ \ No newline at end of file +**/config-overrides.yaml \ No newline at end of file