[BPROC-2448] - Passa usar imagens pagarme pelo ECR #161
Workflow file for this run
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: Lint tests and sonar | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 8.17 | |
cache: 'npm' | |
- name: Run ci (install) | |
run: npm ci | |
- name: Run lint | |
run: npm run lint | |
login-erc: | |
uses: ./.github/workflows/login-ecr.yml | |
secrets: | |
AWS_PULL_ECR_ACCESS_KEY_ID: ${{ secrets.DOCKER_IMAGES_AWS_PULL_ACCESS_KEY_ID }} | |
AWS_PULL_ECR_SECRET_ACCESS_KEY: ${{ secrets.DOCKER_IMAGES_AWS_PULL_SECRET_ACCESS_KEY }} | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: [login-erc] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Instalar Docker Compose Standalone | |
run: | | |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ needs.login-erc.outputs.registry }} | |
username: ${{ needs.login-erc.outputs.docker_username }} | |
password: ${{ needs.login-erc.outputs.docker_password }} | |
- name: Run tests | |
run: make test-ci | |
- name: Upload Test Coverage | |
uses: actions/upload-artifact@v3 | |
with: | |
name: superbowleto-coverage | |
path: | | |
coverage/ | |
sonar: | |
name: Sonar | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download Coverage | |
uses: actions/download-artifact@v3 | |
with: | |
name: superbowleto-coverage | |
path: | | |
coverage/ | |
- name: Override Coverage Source Path for Sonar | |
run: | | |
sed -i 's/\/superbowleto\/src\//src\//g' coverage/lcov.info | |
- name: Run Sonar | |
uses: sonarsource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |