debug #13
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: path-pulse-iot-backend | |
| on: | |
| push: | |
| branches: [ "*" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| config: | |
| name: Configuration for ci | |
| runs-on: ubuntu-latest | |
| outputs: | |
| branch: ${{ steps.secret-name.outputs.demo_secret }} | |
| version: ${{ steps.go-version.outputs.version }} | |
| temp: ${{ steps.temp.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: demo secret | |
| id: secret-name | |
| env: | |
| demo_secret: ${{ secrets.MY_DEMO_SECRET }} | |
| run: echo "demo_secret=${demo_secret:-nothing}">>$GITHUB_OUTPUT | |
| - name: Extract Go Version | |
| id: go-version | |
| run: | | |
| GO_VERSION=$(grep '^go ' go.mod | awk '{ print $2}') | |
| echo "Extracted Go version: $GO_VERSION" | |
| echo "version=${GO_VERSION:-1.20}" >> $GITHUB_OUTPUT | |
| - name: temp | |
| id: temp | |
| env: | |
| tempu: "demo" | |
| run: echo "printing tempus $tempu" >> $GITHUB_OUTPUT | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: config | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ${{ needs.config.outputs.version }} | |
| - name: Echo Secret | |
| env: | |
| demo_secret: ${{ needs.config.outputs.branch }} | |
| temp: ${{ needs.config.outputs.temp }} | |
| run: | | |
| echo "printing $demo_secret and $temp" | |
| - name: Build | |
| run: go build -v ./... | |
| - name: Test | |
| run: go test -v ./... |