-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add CD * Fix offenses * Fix version * Fix version
- Loading branch information
1 parent
c495536
commit 0ef9641
Showing
9 changed files
with
88 additions
and
13 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 |
---|---|---|
@@ -1,13 +1,31 @@ | ||
name: "[CI] Cleaner" | ||
name: "CI/CD" | ||
on: [push] | ||
|
||
env: | ||
CI: "true" | ||
CODECOV: "true" | ||
RUBY_VERSION: 3.1.1 | ||
NODE_VERSION: 16.9.1 | ||
|
||
jobs: | ||
main: | ||
lint: | ||
name: Lint code | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: rokroskar/[email protected] | ||
if: "github.ref != 'refs/heads/develop'" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Run Rubocop | ||
run: bundle exec rubocop -P | ||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
@@ -55,9 +73,14 @@ jobs: | |
- run: mkdir -p ./spec/decidim_dummy_app/tmp/screenshots | ||
name: Create the screenshots folder | ||
- uses: nanasess/[email protected] | ||
- run: RAILS_ENV=test bundle exec rails assets:precompile | ||
name: Precompile assets | ||
working-directory: ./spec/decidim_dummy_app/ | ||
- name: Run precompile if needed | ||
run: | | ||
if [[ -d "app/views" ]] || [[ -d "spec/mailers" ]] || [[ -d "spec/system" ]]; then | ||
cd "spec/decidim_dummy_app" | ||
bundle exec rails assets:precompile | ||
else | ||
echo "No need to precompile assets since system folder is empty" | ||
fi | ||
- run: bundle exec rspec | ||
name: RSpec | ||
- uses: codecov/codecov-action@v1 | ||
|
@@ -67,3 +90,45 @@ jobs: | |
name: screenshots | ||
path: ./spec/decidim_dummy_app/tmp/screenshots | ||
if-no-files-found: ignore | ||
release: | ||
if: "github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'" | ||
needs: [tests, lint] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Setup git and gh | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token | ||
- run: gem install parse_gemspec-cli | ||
name: Intall gem parser | ||
- run: echo "::set-output name=tag::$(parse-gemspec-cli *.gemspec | jq .'version')" | ||
name: Set tag version | ||
id: set_tag | ||
- name: Add tag and push | ||
run: | | ||
git tag | ||
git push --tags | ||
- name: Create release | ||
run: gh release create ${{ steps.set_tag.outputs.tag }} --generate-notes | ||
publish: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Publish to RubyGems | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
gem build *.gemspec | ||
gem push *.gem | ||
env: | ||
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}" |
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
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
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
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
2 changes: 2 additions & 0 deletions
2
db/migrate/20230110150032_add_delete_inactive_users_to_organization.rb
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
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
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
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