diff --git a/.github/workflows/main.yml b/.github/workflows/docker.yml similarity index 85% rename from .github/workflows/main.yml rename to .github/workflows/docker.yml index 967cda9..1d6b9ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/docker.yml @@ -1,34 +1,22 @@ -name: Docker +name: Build images on: - schedule: - - cron: '17 3 * * *' workflow_call: {} workflow_dispatch: - env: REGISTRY: ghcr.io IMAGE_NAME: salsadigitalauorg/internal-services-monitor jobs: - tests: - name: Test the monitor - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '1.22' - - name: Run tests - run: go test ./... + lint-test: + uses: ./.github/worfklows/test.yml build: runs-on: ubuntu-latest timeout-minutes: 10 + needs: [lint-test] permissions: contents: read packages: write diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..206de98 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test and lint + +on: + workflow_call: + push: + branches: + - main + pull_request: + +jobs: + + lint-test: + name: Quality assurance + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.22' + + - name: Vet + run : go vet ./... + + - name: Tests + run: go test ./...