-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b29c4d
commit dba862c
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Análise de Código | ||
|
||
on: push | ||
|
||
jobs: | ||
sonarcloud: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout ✅ | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup 🏗 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: lts/* | ||
cache: "npm" | ||
|
||
- name: Install ⚙️ | ||
run: npm install | ||
|
||
- name: Build 🛠 | ||
run: npm run build | ||
|
||
- name: Test 📋 | ||
run: npm run test:prod | ||
|
||
- name: Executa SonarCloud Scan | ||
if: ${{ always() }} | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{secrets.API_TOKEN_GITHUB}} | ||
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
types: [closed] | ||
|
||
jobs: | ||
release: | ||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'NOT RELEASE') == false | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cria arquivo .env | ||
run: | | ||
touch ./scripts/.env | ||
echo TOKEN=${{ secrets.API_TOKEN_GITHUB }} >> ./scripts/.env | ||
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./scripts/.env | ||
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./scripts/.env | ||
echo RELEASE_FIX=${{ contains(github.event.pull_request.labels.*.name, 'FIX RELEASE') }} >> ./scripts/.env | ||
echo DEVELOP=${{ contains(github.event.pull_request.labels.*.name, 'DEVELOP') }} >> ./scripts/.env | ||
- name: Gera release e envia métricas para repositório de DOC | ||
run: | | ||
cd scripts && yarn install && node release.js | ||
git config --global user.email "${{secrets.GIT_USER_EMAIL}}" | ||
git config --global user.name "${{secrets.GIT_USER_NAME}}" | ||
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_GITHUB}}@github.com/fga-eps-mds/${{secrets.GIT_DOC_REPO}}" ${{secrets.GIT_DOC_REPO}} | ||
mkdir -p ${{secrets.GIT_DOC_REPO}}/analytics-raw-data | ||
cp -R analytics-raw-data/*.json ${{secrets.GIT_DOC_REPO}}/analytics-raw-data | ||
cd ${{secrets.GIT_DOC_REPO}} | ||
git add . | ||
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}" | ||
git push |