name: Source Plugin Hacker News Workflow concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: pull_request: paths: - "plugins/source/hackernews/**" - ".github/workflows/source_hackernews.yml" push: branches: - main paths: - "plugins/source/hackernews/**" - ".github/workflows/source_hackernews.yml" jobs: plugins-source-hackernews: timeout-minutes: 30 name: "plugins/source/hackernews" runs-on: ubuntu-latest defaults: run: working-directory: ./plugins/source/hackernews steps: - uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Go 1.x uses: actions/setup-go@v5 with: go-version-file: plugins/source/hackernews/go.mod cache: true cache-dependency-path: plugins/source/hackernews/go.sum - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: version: v1.55.2 working-directory: plugins/source/hackernews args: "--config ../../.golangci.yml" - name: Setup CloudQuery if: github.event_name == 'pull_request' uses: cloudquery/setup-cloudquery@v3 with: version: v6.4.1 - name: gen if: github.event_name == 'pull_request' run: make gen - name: Fail if generation updated files if: github.event_name == 'pull_request' run: test "$(git status -s | wc -l)" -eq 0 || (git status -s; exit 1) - name: Build run: go build . - name: Test run: make test validate-config-ui: timeout-minutes: 15 if: github.event_name == 'pull_request' permissions: id-token: write contents: read runs-on: ubuntu-latest defaults: run: working-directory: ./plugins/source/hackernews steps: - uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Go 1.x uses: actions/setup-go@v5 with: go-version-file: plugins/source/hackernews/go.mod cache: true cache-dependency-path: plugins/source/hackernews/go.sum - name: Setup CloudQuery uses: cloudquery/setup-cloudquery@v3 with: version: v6.4.1 - name: Gen run: make gen - name: Build run: go build . - name: Use Node.js LTS uses: actions/setup-node@v4 with: node-version: "lts/*" cache: "npm" cache-dependency-path: "plugins/source/hackernews/cloud-config-ui/package-lock.json" - name: Install dependencies working-directory: "plugins/source/hackernews/cloud-config-ui" run: npm ci - name: Install dotenv run: npm install dotenv-cli -g - name: Install Playwright working-directory: "plugins/source/hackernews/cloud-config-ui" run: npx playwright install --with-deps - name: Build config UI working-directory: "plugins/source/hackernews/cloud-config-ui" run: REACT_APP_USE_CLOUD_APP_MOCK=true npm run build - name: Run E2E tests and generate configs working-directory: "plugins/source/hackernews/cloud-config-ui" run: E2E_TESTS_GENERATE_CONFIG=true npm run test:e2e - name: Validate CloudQuery config working-directory: "plugins/source/hackernews/cloud-config-ui" run: dotenv -e ./temp/.env -- cloudquery validate-config ./temp/config.yml env: CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}