Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #7

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions .github/workflows/opendata-ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Open Data CI
on:
push:
branches:
- dev
paths:
- 'src/open-data/**/*.{csv,json}'
pull_request:
types: [opened, synchronize, reopened]
branches:
- dev
paths:
- 'src/open-data/**/*.{csv,json}'
- 'src/open-data/**/*.csv'
- 'src/open-data/**/*.json'
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -35,32 +32,20 @@ jobs:
- name: Display environment variable "commit-author"
run: echo "commit-author=${{ env.commit-author }}"

- name: Set environment variable "is-auto-commit"
if: env.commit-message == env.CI_COMMIT_MESSAGE && env.commit-author == env.CI_COMMIT_AUTHOR
run: echo "is-auto-commit=true" >> $GITHUB_ENV
- name: Display environment variable "is-auto-commit"
run: echo "is-auto-commit=${{ env.is-auto-commit }}"

# Build
- name: Build Open Data
if: env.is-auto-commit == false
shell: pwsh
run: |
src/scripts/Build-OpenData.ps1 -PowerShell
src/scripts/Build-OpenData.ps1 -PowerShell -Test

# Commit generated and commit files
- name: Display event name
run: echo "github.event_name=${{ github.event_name }}"
- name: Commit build artifacts (dist, devdist, docs, coverage)
# Don't run again on already pushed auto commit. Don't run on pull request events.
if: env.is-auto-commit == false && github.event_name != 'pull_request'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "username@users.noreply.github.com"
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
- name: Open Data Unit Testing
if: env.is-auto-commit == true
shell: pwsh
run: |
src/scripts/Get-OpenData.ps1 -Test