Add support for multiple devices for user #403
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
name: docker-publish | |
on: | |
pull_request: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
# step 1: checkout repository code | |
- name: Checkout code into workspace directory | |
uses: actions/checkout@v4 | |
# step 2: set up go | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
# step 3: install dependencies | |
- name: Install all Go dependencies | |
run: go mod download | |
# step 4: run test | |
- name: Run coverage | |
run: go test -race -coverprofile=coverage.out -covermode=atomic ./... | |
e2e: | |
name: E2E | |
runs-on: ubuntu-latest | |
steps: | |
# step 1: checkout repository code | |
- name: Checkout code into workspace directory | |
uses: actions/checkout@v4 | |
# step 2: set up go | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
# step 3: start services | |
- name: Start services | |
env: | |
"FCM__CREDENTIALS_JSON": ${{ secrets.FCM__CREDENTIALS_JSON }} | |
run: docker compose -f test/e2e/docker-compose.yml up -d --build | |
# step 4: run test | |
- name: Run e2e tests | |
run: cd test/e2e && go test -count=1 . | |
# step 5: stop services | |
- name: Stop services | |
run: docker compose -f test/e2e/docker-compose.yml down -v | |
continue-on-error: true | |
build: | |
name: Build | |
permissions: | |
packages: write | |
needs: | |
- test | |
- e2e | |
uses: ./.github/workflows/docker-build.yml | |
with: | |
app-name: sms-gateway | |
secrets: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} |