ajoute le nom du fichier d'où provient l'erreur #1204
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: CI | |
on: | |
push: | |
branches: | |
jobs: | |
go-tests: | |
name: Go tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: go test -v -coverprofile=go-coverage.out -covermode=atomic -coverpkg=./... ./... | |
- name: Show coverage | |
run: go tool cover -func=go-coverage.out | |
mr-tests: | |
name: Map-Reduce tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./js/.nvmrc | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm install --prefer-offline --no-audit | |
working-directory: js | |
- name: Reveal golden master files for tests | |
uses: entrostat/git-secret-action@v4 | |
with: | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY_FOR_GIT_SECRET }} | |
gpg-private-key-passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | |
- name: Run tests + generate coverage report | |
working-directory: js | |
run: npm run test:coverage # stores the coverage report in ./coverage/lcov.info | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: mr-coverage-report | |
path: js/coverage/lcov.info | |
build: | |
name: Generate and lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: make build | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./js/.nvmrc | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- run: npm install --prefer-offline --no-audit | |
working-directory: js | |
- name: Check that generated files are up to date (jsFunctions.go and variables.json) | |
run: | | |
go generate -x ./... | |
git diff | |
exit $(git diff | wc -l) | |
- run: npm run lint | |
working-directory: js | |
- name: Typescript type checks | |
run: npx tsc --noEmit | |
working-directory: js | |
e2e-tests: | |
name: End-to-end tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- name: Reveal golden master files for tests | |
uses: entrostat/git-secret-action@v4 | |
with: | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY_FOR_GIT_SECRET }} | |
gpg-private-key-passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} | |
- run: make build | |
- name: Remove source code | |
run: | | |
# delete all files, except the binary, config, NAF and other data files used by tests | |
find . \ | |
! -name 'sfdata' \ | |
! -name '*.toml' \ | |
! -name 'test*.sh' \ | |
! -name 'sfdata-wrapper.sh' \ | |
! -name 'diff-or-update-golden-master.sh' \ | |
! -name 'mongodb-container.sh' \ | |
! -name 'populate-from-objects.sh' \ | |
! -name 'remove-random_order.sh' \ | |
! -name '*.txt' \ | |
! -name '*.csv' \ | |
! -name '*.json' \ | |
! -name '*.excel' \ | |
! -name 'objects.js' \ | |
-type f \ | |
-exec rm -v {} + | |
- name: Crée le fichier de configuration minimal | |
run: | | |
touch config.toml | |
echo "[log]" >> config.toml | |
echo "level = \"error\"" >> config.toml | |
- run: ./tests/test-cli.sh | |
- run: ./tests/test-prune-entities.sh | |
- run: ./tests/test.sh | |
- run: ./tests/test-import.sh | |
- run: ./tests/test-validate.sh | |
- run: ./tests/test-check.sh | |
- run: ./tests/test-export.sh | |
- run: ./tests/test-public.sh | |
- run: ./tests/test-reduce.sh | |
- run: ./tests/test-compact-failure.sh | |
- run: ./tests/test-compact.sh # relies on encrypted files | |
- run: ./tests/test-reduce-2.sh # relies on encrypted files | |
coverage: | |
name: Send coverage data to Codacy | |
needs: | |
- mr-tests | |
- go-tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: go-coverage-report | |
- uses: actions/download-artifact@v4 | |
with: | |
name: mr-coverage-report | |
- run: cat lcov.info | |
# - uses: codacy/codacy-coverage-reporter-action@master | |
# with: | |
# project-token: ${{ secrets.CODACY_REPOSITORY_TOKEN_FOR_COVERAGE }} | |
# coverage-reports: go-coverage.xml,lcov.info |