-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): init mage build & test pipeline
- Loading branch information
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: template-mage-pipeline | ||
|
||
## workflow will trigger on below condition, | ||
## except image release that have jobs condition to trigger only on tagging | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*.*.*' | ||
|
||
|
||
env: | ||
GCP_REGISTRY_ARTIFACT_PATH: us-docker.pkg.dev/world-engine-test/dark-forest | ||
GCP_PROJECT_ID: world-engine-test | ||
CARDINAL_REGISTRY_PATH: dark-forest/cardinal | ||
NAKAMA_REGISTRY_PATH: dark-forest/nakama | ||
|
||
jobs: | ||
mage-build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Mage - check | ||
uses: magefile/mage-action@v2 | ||
with: | ||
version: latest | ||
args: check | ||
- name: Mage - build | ||
uses: magefile/mage-action@v2 | ||
with: | ||
version: latest | ||
args: build | ||
mage-test: | ||
runs-on: ubuntu-latest | ||
needs: mage-build | ||
defaults: | ||
run: | ||
shell: bash | ||
strategy: | ||
matrix: | ||
go-version: [1.20.x] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Mage - check | ||
uses: magefile/mage-action@v2 | ||
with: | ||
version: latest | ||
args: check | ||
- name: Mage - test | ||
uses: magefile/mage-action@v2 | ||
with: | ||
version: latest | ||
args: test |