Repository navigation
[devices] SIM cards info support #338
Workflow file for this run
This file contains hidden or 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: PR | |
| on: | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| e2e: | |
| name: E2E | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| 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@v6 | |
| with: | |
| go-version: stable | |
| cache-dependency-path: test/e2e/go.sum | |
| # 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 | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| needs: e2e | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| packages: write | |
| steps: | |
| - name: Prepare | |
| run: | | |
| repository=${{ github.repository }} | |
| echo "PROJECT_NAME=${repository#*/}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Login to GitHub Container registry | |
| if: github.actor != 'dependabot[bot]' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| # RELEASE_ID: Days since project inception (2022-06-15) | |
| - name: Set RELEASE_ID env | |
| run: echo RELEASE_ID=$(( ($(date +%s) - $(date -d "2022-06-15" +%s)) / 86400 )) >> ${GITHUB_ENV} | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: release --snapshot | |
| - name: Upload to S3 | |
| uses: capcom6/upload-s3-action@master | |
| env: | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| with: | |
| aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
| aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
| aws_bucket: ${{ secrets.AWS_BUCKET }} | |
| endpoint: ${{ secrets.AWS_ENDPOINT }} | |
| source_files: | | |
| dist/${{ env.PROJECT_NAME }}_*.zip | |
| dist/${{ env.PROJECT_NAME }}_*.tar.gz | |
| destination_dir: ${{ github.repository }}/${{ github.event.pull_request.head.sha }} | |
| - name: Push images | |
| if: github.actor != 'dependabot[bot]' | |
| env: | |
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
| PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
| run: | | |
| docker tag ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:latest-arm64 ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker tag ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:latest-amd64 ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 | |
| docker push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 | |
| docker manifest create ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }} \ | |
| ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 \ | |
| ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker manifest push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }} | |
| - name: Find Comment | |
| uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: "github-actions[bot]" | |
| body-includes: Pull request artifacts | |
| - name: Create or update comment | |
| uses: peter-evans/create-or-update-comment@v4 | |
| env: | |
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }} | |
| PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| ## 🤖 Pull request artifacts | |
| | Platform | File | | |
| | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | |
| | 🐳 Docker | [GitHub Container Registry](https://${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}) | | |
| | 🍎 Darwin arm64 | [${{ env.PROJECT_NAME }}_Darwin_arm64.tar.gz](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Darwin_arm64.tar.gz) | | |
| | 🍎 Darwin x86_64 | [${{ env.PROJECT_NAME }}_Darwin_x86_64.tar.gz](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Darwin_x86_64.tar.gz) | | |
| | 🐧 Linux arm64 | [${{ env.PROJECT_NAME }}_Linux_arm64.tar.gz](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_arm64.tar.gz) | | |
| | 🐧 Linux i386 | [${{ env.PROJECT_NAME }}_Linux_i386.tar.gz](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_i386.tar.gz) | | |
| | 🐧 Linux x86_64 | [${{ env.PROJECT_NAME }}_Linux_x86_64.tar.gz](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_x86_64.tar.gz) | | |
| | 🪟 Windows arm64 | [${{ env.PROJECT_NAME }}_Windows_arm64.zip](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_arm64.zip) | | |
| | 🪟 Windows i386 | [${{ env.PROJECT_NAME }}_Windows_i386.zip](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_i386.zip) | | |
| | 🪟 Windows x86_64 | [${{ env.PROJECT_NAME }}_Windows_x86_64.zip](https://s3.sms-gate.app/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_x86_64.zip) | | |
| edit-mode: replace |